Skip to content

Fix union field table handling #239

Fix union field table handling

Fix union field table handling #239

Workflow file for this run

name: CI
on:
push:
branches: main
tags: v*
pull_request:
branches: "*"
jobs:
all:
name: all
runs-on: ubuntu-24.04
permissions:
# https://docs.npmjs.com/generating-provenance-statements#publishing-packages-with-provenance-via-github-actions
id-token: write
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version: 20
registry-url: https://registry.npmjs.org
cache: yarn
- run: DOWNLOAD_FLATC=linux ./generate_files.sh
- name: Ensure generated files are up to date
run: |
changes=$(git status --porcelain)
if [ -n "$changes" ]; then
echo "::error::The following generated files need to be updated. Run generate_files.sh to update them."
echo "$changes"
exit 1
else
echo "Generated files are up to date!"
fi
- run: yarn install --frozen-lockfile
- run: yarn run build
- run: yarn run lint
- run: yarn run test
- run: yarn pack
- name: Publish to NPM (dry run)
# `yarn publish` does not support --provenance
run: npm publish flatbuffers_reflection-*.tgz --provenance --access public --dry-run
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- name: Publish to NPM
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: |
PACKAGE_VERSION="refs/tags/v$(cat package.json | jq .version -r)"
if [ ${{ github.ref }} != "${PACKAGE_VERSION}" ]; then
echo "::error::The package.json version does not match the git tag used for this release."
echo "${PACKAGE_VERSION}"
echo ${{ github.ref }}
exit 1
fi
# `yarn publish` does not support --provenance
npm publish flatbuffers_reflection-*.tgz --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}