|
1 | 1 | name: 'Gitflow: Auto prepare release' |
2 | 2 | on: |
3 | | - pull_request: |
4 | | - types: |
5 | | - - closed |
6 | | - branches: |
7 | | - - master |
8 | | - |
9 | | -# This workflow tirggers a release when merging a branch with the pattern `prepare-release/VERSION` into master. |
| 3 | + workflow_dispatch: |
| 4 | + inputs: |
| 5 | + version: |
| 6 | + description: Version to release (or "auto") |
| 7 | + required: false |
| 8 | + force: |
| 9 | + description: Force a release even when there are release-blockers |
| 10 | + required: false |
| 11 | + merge_target: |
| 12 | + description: Target branch to merge into |
| 13 | + required: false |
10 | 14 | jobs: |
11 | 15 | release: |
12 | | - runs-on: ubuntu-24.04 |
13 | | - name: 'Prepare a new version' |
14 | | - |
15 | | - 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 | | - |
23 | | - - uses: actions/checkout@v6 |
24 | | - with: |
25 | | - token: ${{ steps.token.outputs.token }} |
26 | | - fetch-depth: 0 |
27 | | - |
28 | | - # https://github.com/actions-ecosystem/action-regex-match |
29 | | - - uses: actions-ecosystem/action-regex-match@v2 |
30 | | - id: version-regex |
31 | | - with: |
32 | | - # Parse version from head branch |
33 | | - text: ${{ github.head_ref }} |
34 | | - # match: preprare-release/xx.xx.xx |
35 | | - regex: '^prepare-release\/(\d+\.\d+\.\d+)(?:-(alpha|beta|rc)\.\d+)?$' |
36 | | - |
37 | | - - name: Extract version |
38 | | - id: get_version |
39 | | - run: | |
40 | | - version=${{ steps.version-regex.outputs.match }} |
41 | | - version=${version/'prepare-release/'/''} |
42 | | - echo "version=$version" >> $GITHUB_OUTPUT |
43 | | -
|
44 | | - - name: Set up Node |
45 | | - uses: actions/setup-node@v6 |
46 | | - with: |
47 | | - node-version-file: 'package.json' |
48 | | - |
49 | | - - name: Prepare release |
50 | | - uses: getsentry/action-prepare-release@v1 |
51 | | - if: |
52 | | - github.event.pull_request.merged == true && steps.version-regex.outputs.match != '' && |
53 | | - steps.get_version.outputs.version != '' |
54 | | - env: |
55 | | - GITHUB_TOKEN: ${{ steps.token.outputs.token }} |
56 | | - with: |
57 | | - version: ${{ steps.get_version.outputs.version }} |
58 | | - force: false |
59 | | - merge_target: master |
60 | | - craft_config_from_merge_target: true |
| 16 | + uses: getsentry/craft/.github/workflows/release.yml@v2 |
| 17 | + with: |
| 18 | + version: ${{ inputs.version }} |
| 19 | + force: ${{ inputs.force }} |
| 20 | + merge_target: ${{ inputs.merge_target }} |
| 21 | + craft_config_from_merge_target: 'true' |
| 22 | + secrets: inherit |
0 commit comments