44 workflow_dispatch :
55 inputs :
66 dry_run :
7- description : ' Dry run'
7+ description : ' Dry run - print the version that would be published, but do not commit or publish anything.'
8+ required : false
9+ default : false
10+ type : boolean
11+ skip_versioning :
12+ description : >
13+ Skip version bump - use the version already in the repo
14+ (e.g. retry after npm publish failed but the release commit is already pushed).
815 required : false
916 default : false
1017 type : boolean
@@ -36,32 +43,33 @@ jobs:
3643 registry-url : ' https://registry.npmjs.org'
3744
3845 - name : Install dependencies
46+ if : ${{ !inputs.skip_versioning }}
3947 run : npm ci
4048
4149 - name : Determine version bump
4250 id : bump
51+ if : ${{ !inputs.skip_versioning }}
4352 working-directory : packages/blockly
4453 run : |
4554 RELEASE_TYPE=$(npx conventional-recommended-bump --preset conventionalcommits -t blockly-)
4655 echo "release_type=$RELEASE_TYPE" >> "$GITHUB_OUTPUT"
4756 echo "Recommended bump: $RELEASE_TYPE"
4857
4958 - name : Apply version bump
59+ if : ${{ !inputs.skip_versioning }}
5060 working-directory : packages/blockly
5161 run : npm version ${{ steps.bump.outputs.release_type }} --no-git-tag-version
5262
53- - name : Read new version
63+ - name : Read package version
5464 id : version
5565 working-directory : packages/blockly
5666 run : |
5767 VERSION=$(node -p "require('./package.json').version")
5868 echo "version=$VERSION" >> "$GITHUB_OUTPUT"
59- echo "New version: $VERSION"
60-
61- - name : Update lockfile
62- run : npm install
69+ echo "Version: $VERSION"
6370
6471 - name : Upload versioned files
72+ if : ${{ !inputs.skip_versioning }}
6573 uses : actions/upload-artifact@v4
6674 with :
6775 name : versioned-files
@@ -82,11 +90,13 @@ jobs:
8290 ssh-key : ${{ secrets.DEPLOY_PRIVATE_KEY }}
8391
8492 - name : Download versioned files
93+ if : ${{ !inputs.skip_versioning }}
8594 uses : actions/download-artifact@v4
8695 with :
8796 name : versioned-files
8897
8998 - name : Commit and push version bump
99+ if : ${{ !inputs.skip_versioning }}
90100 run : |
91101 git config user.name "github-actions[bot]"
92102 git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
@@ -109,7 +119,7 @@ jobs:
109119
110120 - name : Publish to npm
111121 working-directory : packages/blockly/dist
112- run : npm publish
122+ run : npm publish --verbose
113123
114124 - name : Create tarball
115125 working-directory : packages/blockly
0 commit comments