Skip to content

Commit 0e37298

Browse files
authored
ci(release): Switch from action-prepare-release to Craft (#381)
This PR migrates from the deprecated action-prepare-release to the new Craft GitHub Actions (reusable workflow or composite action).
1 parent 7f8bb89 commit 0e37298

File tree

7 files changed

+52
-27
lines changed

7 files changed

+52
-27
lines changed

.craft.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
minVersion: '0.23.1'
22
changelogPolicy: auto
3-
preReleaseCommand: ruby .scripts/bump-version.rb
3+
preReleaseCommand: ruby .scripts/bump-version.rb "$CRAFT_OLD_VERSION" "$CRAFT_NEW_VERSION"
44
targets:
55
- name: gem
66
- name: registry
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/integration-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
matrix:
1414
os: [macos-latest, windows-latest, ubuntu-latest]
1515
steps:
16-
- uses: actions/checkout@v6
16+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
1717
- uses: actions/setup-python@v6
1818
with:
1919
python-version: '3.11.9'

.github/workflows/prepare_release.yml

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,34 @@ 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
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
1115
jobs:
1216
release:
1317
runs-on: ubuntu-latest
14-
name: "Release a new version"
18+
name: Release a new version
1519
steps:
16-
- name: Get auth token
17-
id: token
18-
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
19-
with:
20-
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
21-
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
22-
- uses: actions/checkout@v6
23-
with:
24-
token: ${{ steps.token.outputs.token }}
25-
fetch-depth: 0
26-
- name: Prepare release
27-
uses: getsentry/action-prepare-release@v1
28-
env:
29-
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
30-
with:
31-
version: ${{ github.event.inputs.version }}
32-
force: ${{ github.event.inputs.force }}
20+
- name: Get auth token
21+
id: token
22+
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2
23+
with:
24+
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
25+
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
26+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
27+
with:
28+
token: ${{ steps.token.outputs.token }}
29+
fetch-depth: 0
30+
- name: Prepare release
31+
uses: getsentry/craft@39ee616a6a58dc64797feecb145d66770492b66c # v2
32+
env:
33+
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
34+
with:
35+
version: ${{ inputs.version }}
36+
force: ${{ inputs.force }}

.github/workflows/release.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@ on:
55
push:
66
branches:
77
- release/**
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
812
jobs:
913
build:
1014
name: Build
1115
runs-on: ubuntu-latest
1216
steps:
13-
- uses: actions/checkout@v6
14-
- uses: actions/setup-node@v6
17+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
18+
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6
1519
- name: Set up Ruby
1620
uses: ruby/setup-ruby@v1
1721
with:

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
test:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v6
14+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
1515

1616
- name: Install sentry-cli
1717
run: curl -sL https://sentry.io/get-cli/ | bash

.github/workflows/update-deps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
if: needs.update-cli.outputs.originalTag != needs.update-cli.outputs.latestTag
2525
steps:
2626
- name: Checkout PR branch
27-
uses: actions/checkout@v6
27+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
2828
with:
2929
ref: ${{ needs.update-cli.outputs.prBranch }}
3030
- name: Download latest binaries.

0 commit comments

Comments
 (0)