Repository navigation
68 lines (61 loc) · 1.98 KB
/
Copy pathrelease.yml
File metadata and controls
68 lines (61 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Release
on:
push:
branches:
- main
workflow_dispatch:
inputs:
version:
description: Version to release (semver, "auto", "major", "minor", "patch")
default: minor
required: false
force:
description: Force release
default: false
type: boolean
merge_target:
description: Merge target branch
default: main
required: false
permissions:
contents: write
pull-requests: write
jobs:
release:
runs-on: ubuntu-latest
name: Release a new version
# Craft merges release branches by SHA, producing "Merge commit '...'".
if: >-
github.event_name == 'workflow_dispatch' ||
(
!startsWith(github.event.head_commit.message, 'Merge branch ''release/') &&
!(github.actor == 'sentry-release-bot[bot]' &&
startsWith(github.event.head_commit.message, 'Merge commit '))
)
# Apply concurrency after the guard so skipped merges cannot cancel a release.
concurrency:
group: release
cancel-in-progress: true
steps:
- name: Get auth token
id: token
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
with:
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
token: ${{ steps.token.outputs.token }}
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 24
- name: Prepare release
uses: getsentry/craft@f4889d04564e47311038ecb6b910fef6b6cf1363 # v2
env:
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
with:
version: ${{ inputs.version }}
force: ${{ inputs.force }}
merge_target: ${{ inputs.merge_target || 'main' }}