Repository navigation
90 lines (79 loc) · 2.47 KB
/
Copy pathrelease.yaml
File metadata and controls
90 lines (79 loc) · 2.47 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Release
run-name: Release ${{ inputs.custom_version || inputs.bump_type }} by @${{ github.actor }}
on:
workflow_dispatch:
inputs:
bump_type:
description: Version increment
required: true
default: minor
type: choice
options:
- minor
- patch
- major
- custom
custom_version:
description: Exact version when increment is custom (for example 3.0.0)
required: false
type: string
dry_run:
description: Validate and preview without changing GitHub
required: true
default: false
type: boolean
concurrency:
group: production-release
cancel-in-progress: false
permissions:
contents: read
jobs:
release:
name: Orchestrate release
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Create release app token
id: app-token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ vars.RELEASE_APP_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
permission-actions: read
permission-checks: read
permission-contents: write
permission-pull-requests: write
permission-statuses: read
- name: Check out develop
uses: actions/checkout@v7
with:
ref: develop
fetch-depth: 0
persist-credentials: false
token: ${{ steps.app-token.outputs.token }}
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: 22.23.4
cache: yarn
cache-dependency-path: website/yarn.lock
- name: Configure release bot
env:
APP_SLUG: ${{ steps.app-token.outputs.app-slug }}
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
app_user="${APP_SLUG}[bot]"
app_user_id="$(gh api "/users/${app_user}" --jq .id)"
git config user.name "${app_user}"
git config user.email \
"${app_user_id}+${app_user}@users.noreply.github.com"
gh auth setup-git
- name: Test release automation
run: node --test scripts/release/*.test.mjs
- name: Run release
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
RELEASE_BUMP: ${{ inputs.bump_type }}
RELEASE_VERSION: ${{ inputs.custom_version }}
RELEASE_DRY_RUN: ${{ inputs.dry_run }}
run: node scripts/release/release.mjs