Skip to content

Commit bb1fe27

Browse files
authored
fix: handle release race condition (#1381)
1 parent 6e06cc9 commit bb1fe27

1 file changed

Lines changed: 25 additions & 6 deletions

File tree

.github/workflows/code-release.yml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,6 @@ jobs:
124124
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
125125
run: pnpm --filter code run publish
126126

127-
- name: Publish GitHub release
128-
env:
129-
GH_TOKEN: ${{ steps.app-token.outputs.token }}
130-
APP_VERSION: ${{ steps.version.outputs.version }}
131-
run: gh release edit "v$APP_VERSION" --repo PostHog/code --draft=false
132-
133127
publish-windows:
134128
runs-on: windows-latest
135129
permissions:
@@ -202,3 +196,28 @@ jobs:
202196
APP_VERSION: ${{ steps.version.outputs.version }}
203197
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
204198
run: pnpm --filter code run publish
199+
200+
finalize-release:
201+
needs: [publish-macos, publish-windows]
202+
runs-on: ubuntu-latest
203+
permissions:
204+
contents: write
205+
steps:
206+
- name: Get app token
207+
id: app-token
208+
uses: getsentry/action-github-app-token@d4b5da6c5e37703f8c3b3e43abb5705b46e159cc # v3
209+
with:
210+
app_id: ${{ secrets.GH_APP_ARRAY_RELEASER_APP_ID }}
211+
private_key: ${{ secrets.GH_APP_ARRAY_RELEASER_PRIVATE_KEY }}
212+
213+
- name: Extract version from tag
214+
id: version
215+
run: |
216+
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
217+
echo "version=$TAG_VERSION" >> "$GITHUB_OUTPUT"
218+
219+
- name: Publish GitHub release
220+
env:
221+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
222+
APP_VERSION: ${{ steps.version.outputs.version }}
223+
run: gh release edit "v$APP_VERSION" --repo PostHog/code --draft=false

0 commit comments

Comments
 (0)