From bb7d3e4e6c4192d6d8ed67330436751daf489ccb Mon Sep 17 00:00:00 2001 From: Zach Plata Date: Wed, 20 Apr 2022 13:04:28 -0700 Subject: [PATCH] Feat: Setup workflow to npm publish 2 new rive-react packages --- .github/workflows/publish.yml | 19 +++++++++++++++++-- scripts/bump_version.sh | 3 +++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index deeb904..3c8466c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -44,15 +44,30 @@ jobs: run: npm run lint - name: Run Tests run: npm test - - name: Build + - name: Build main dist run: npm run build + - name: Copy separated builds + run: ./scripts/build.sh + - name: Copy package jsons to separate react outputs + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: ./scripts/setup_all_packages.sh + - name: Bump Versions of react outputs + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + RELEASE_VERSION: ${{ needs.determine_version.outputs.version }} + run: ./scripts/bump_all_versions.sh - name: Git config run: | git config --local user.email 'hello@rive.app' git config --local user.name ${{ github.actor }} - name: Authenticate with registry run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }} - - name: Release + - name: Release rive-react env: GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} run: npm run release -- --ci + - name: Release @rive-app/react-* variants + env: + GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} + run: ./scripts/publish_all.sh diff --git a/scripts/bump_version.sh b/scripts/bump_version.sh index defb51c..2bbc83e 100755 --- a/scripts/bump_version.sh +++ b/scripts/bump_version.sh @@ -7,3 +7,6 @@ set -e SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # RELEASE_VERSION will come from an env variable passed in from the GH action workflow node $SCRIPT_DIR/nextVersion.js "$RELEASE_VERSION" `pwd` + +# Replace the dist package json with the newly trimmed one +cp -f ./package.json ./dist/package.json