Skip to content

Commit eceffda

Browse files
wip
1 parent ddb1241 commit eceffda

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

.github/workflows/release.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@ name: Release - Traceloop SDK & Standalone Instrumentations
22

33
on:
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

611
jobs:
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"
@@ -62,4 +80,6 @@ jobs:
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

Comments
 (0)