Skip to content

PR for release-22222222.99201.1482 #76

PR for release-22222222.99201.1482

PR for release-22222222.99201.1482 #76

Workflow file for this run

name: Publish JSON package
on:
pull_request:
branches:
- main
types:
- closed
jobs:
build-json-archive:
name: Generate and package JSON files
if: ${{ github.event.pull_request.merged }}
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Target directory
run: mkdir json js
- name: Transform to JSON
run: for f in res/*.yaml; do fn=${f##*/}; yq -o json < $f > json/${fn%.*}.json; done
- name: Transform to JS spec assignment
run: for f in json/*.json; do fn=${f##*/}; echo "const spec = $(cat $f)" > js/${fn%.*}.js; done
- name: Make a release archive
run: tar -czf ${{ github.head_ref }}.tar.gz json/ js/
- name: Create release and upload
uses: ncipollo/release-action@v1
with:
artifacts: ${{ github.head_ref }}.tar.gz
tag: ${{ github.head_ref }}
omitBody: true