@@ -2,12 +2,18 @@ name: Release - Traceloop SDK & Standalone Instrumentations
22
33on :
44 workflow_dispatch :
5+ inputs :
6+ publish-only :
7+ description : " Skip versioning and only publish existing version from git tags"
8+ type : boolean
9+ default : false
510
611jobs :
712 release :
813 runs-on : ubuntu-latest
914 permissions :
1015 id-token : write
16+ contents : read
1117 steps :
1218 - name : Generate GitHub App Token
1319 id : app-token
@@ -35,19 +41,31 @@ jobs:
3541 - name : Build
3642 run : pnpm nx run-many --target=build --parallel=3
3743 - name : Git Identity
44+ if : ${{ !inputs.publish-only }}
3845 run : |
3946 git config --global user.name 'github-actions[bot]'
4047 git config --global user.email 'github-actions[bot]@users.noreply.github.com'
4148 git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY
4249 env :
4350 GITHUB_TOKEN : ${{ steps.app-token.outputs.token }}
4451 - name : Create Version
45- run : pnpm lerna version --no-private --conventional-commits --yes
52+ if : ${{ !inputs.publish-only }}
53+ run : |
54+ VERSION_BEFORE=$(node -p 'require("./lerna.json").version')
55+ pnpm lerna version --no-private --conventional-commits --yes
56+ VERSION_AFTER=$(node -p 'require("./lerna.json").version')
57+ if [ "$VERSION_BEFORE" = "$VERSION_AFTER" ]; then
58+ echo "::error::lerna version did not create a new version (still $VERSION_BEFORE). No new conventional commits?"
59+ exit 1
60+ fi
61+ echo "Version bumped: $VERSION_BEFORE -> $VERSION_AFTER"
4662 - name : Set Current Version
63+ if : ${{ !inputs.publish-only }}
4764 run : |
4865 CURRENT_VERSION=$(node -p 'require("./lerna.json").version')
4966 echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV
5067 - name : Create Release
68+ if : ${{ !inputs.publish-only }}
5169 uses : softprops/action-gh-release@v1
5270 with :
5371 body_path : " CHANGELOG.md"
6280 - name : Build for Release
6381 run : pnpm nx run-many --target=build --parallel=3
6482 - name : Publish
65- run : pnpm lerna publish --no-private from-git --yes
83+ run : pnpm lerna publish --no-private from-git --yes --no-verify-access
84+ env :
85+ ACTIONS_ID_TOKEN_REQUEST_URL : " "
0 commit comments