From 5ec7a58aee125fcbb778e7a9f2949c6e8b2b820c Mon Sep 17 00:00:00 2001 From: Peter Salomonsen Date: Fri, 5 Jan 2024 17:40:07 +0000 Subject: [PATCH 1/2] fix release --- .github/workflows/release.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b853ffda..68ae2c97 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,12 +16,14 @@ jobs: export VERSION=`npm view wasm-music dist-tags.latest` export NEWVERSION=`node -p "require('./package.json').version"` echo $VERSION $NEWVERSION - if [ "$VERSION" != "$NEWVERSION" ] - then - npm install - echo "creating pianorolldemo bundle" - npm run bundle-pianorolldemo - echo "publishing new version" + yarn install + echo "creating pianorolldemo bundle" + yarn bundle-pianorolldemo + echo "publishing new version" + if [[ "$VERSION" = "$NEWVERSION" || "$BRANCH" != "master" ]]; then + echo "version change is $VERSION->$NEWVERSION, branch is $BRANCH, not publishing, only dry-run" + npm publish --dry-run + else npm publish fi env: From 6a69f2aebf3173424393010d756e1dce4d916a98 Mon Sep 17 00:00:00 2001 From: Peter Salomonsen Date: Fri, 5 Jan 2024 18:15:14 +0000 Subject: [PATCH 2/2] must also be run on PR --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 68ae2c97..88c923a2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,6 +2,8 @@ name: Release on: push: branches: [ master ] + pull_request: + branches: [ master ] jobs: build: runs-on: ubuntu-latest