Skip to content

Commit cd4b7e3

Browse files
authored
ci(release): Switch from action-prepare-release to Craft (#25)
1 parent 26889d1 commit cd4b7e3

File tree

3 files changed

+54
-34
lines changed

3 files changed

+54
-34
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Changelog Preview
2+
on:
3+
pull_request:
4+
types:
5+
- opened
6+
- synchronize
7+
- reopened
8+
- edited
9+
- labeled
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
14+
jobs:
15+
changelog-preview:
16+
uses: getsentry/craft/.github/workflows/changelog-preview.yml@v2
17+
secrets: inherit

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Check out current commit
20-
uses: actions/checkout@v4
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
2121
- name: Set up Node
22-
uses: actions/setup-node@v4
22+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
2323
with:
2424
node-version-file: "package.json"
2525
- name: Install dependencies
@@ -179,14 +179,14 @@ jobs:
179179
ln -sf python3 /usr/bin/python
180180
181181
- name: Check out current commit
182-
uses: actions/checkout@v4
182+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
183183

184184
# Note: On alpine images, this does nothing
185185
# The node version will be the one that is installed in the image
186186
# If you want to change the node version, you need to change the image
187187
# For non-alpine images, this will install the correct version of node
188188
- name: Setup Node
189-
uses: actions/setup-node@v4
189+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
190190
if: contains(matrix.container, 'alpine') == false
191191
with:
192192
node-version: ${{ matrix.node }}
@@ -280,9 +280,9 @@ jobs:
280280
runs-on: ubuntu-latest
281281
steps:
282282
- name: Check out current commit
283-
uses: actions/checkout@v4
283+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
284284
- name: Set up Node
285-
uses: actions/setup-node@v4
285+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
286286
with:
287287
node-version-file: "package.json"
288288

@@ -327,9 +327,9 @@ jobs:
327327
node: [18, 20, 22, 24]
328328
steps:
329329
- name: Check out current commit
330-
uses: actions/checkout@v4
330+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
331331
- name: Set up Node
332-
uses: actions/setup-node@v4
332+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
333333
with:
334334
node-version: ${{ matrix.node }}
335335
- name: Install dependencies

.github/workflows/release.yml

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,39 @@ on:
33
workflow_dispatch:
44
inputs:
55
version:
6-
description: Version to release
7-
required: true
6+
description: Version to release (or "auto")
7+
required: false
88
force:
9-
description: Force a release even when there are release-blockers (optional)
9+
description: Force a release even when there are release-blockers
1010
required: false
1111
merge_target:
12-
description: Target branch to merge into. Uses the default branch as a fallback (optional)
12+
description: Target branch to merge into
1313
required: false
14-
default: main
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
1518
jobs:
1619
release:
17-
runs-on: ubuntu-22.04
18-
name: "Release a new version"
20+
runs-on: ubuntu-latest
21+
name: Release a new version
1922
steps:
20-
- name: Get auth token
21-
id: token
22-
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
23-
with:
24-
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
25-
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
26-
- uses: actions/checkout@v4
27-
with:
28-
token: ${{ steps.token.outputs.token }}
29-
fetch-depth: 0
30-
- name: Prepare release
31-
uses: getsentry/action-prepare-release@v1
32-
env:
33-
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
34-
with:
35-
version: ${{ github.event.inputs.version }}
36-
force: ${{ github.event.inputs.force }}
37-
merge_target: ${{ github.event.inputs.merge_target }}
38-
craft_config_from_merge_target: true
23+
- name: Get auth token
24+
id: token
25+
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2
26+
with:
27+
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
28+
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
29+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
30+
with:
31+
token: ${{ steps.token.outputs.token }}
32+
fetch-depth: 0
33+
- name: Prepare release
34+
uses: getsentry/craft@39ee616a6a58dc64797feecb145d66770492b66c # v2
35+
env:
36+
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
37+
with:
38+
version: ${{ inputs.version }}
39+
force: ${{ inputs.force }}
40+
merge_target: ${{ inputs.merge_target }}
41+
craft_config_from_merge_target: 'true'

0 commit comments

Comments
 (0)