-
Notifications
You must be signed in to change notification settings - Fork 13
119 lines (102 loc) · 4.06 KB
/
app-release-v2.yml
File metadata and controls
119 lines (102 loc) · 4.06 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: App Release (New)
on:
workflow_dispatch:
inputs:
base_commit:
description: 'Commit SHA to start release from (default: main HEAD)'
required: false
type: string
permissions:
contents: write
pull-requests: write
jobs:
prepare-release:
runs-on: ubuntu-latest
steps:
- name: Load secrets
id: load-secrets
uses: 1password/load-secrets-action@v4.0.0
with:
export-env: false
env:
OP_SERVICE_ACCOUNT_TOKEN: '${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}'
GPG_PASSPHRASE: op://kv_app_infra/arabot-1_SIGN_CERTS/credential
GPG_PRIVATE_KEY: op://kv_app_infra/arabot-1_SIGN_CERTS/private_key
ARABOT_PAT: op://kv_app_infra/ARABOT_PAT/credential
SLACK_BOT_TOKEN: op://kv_app_infra/SLACK_BOT_TOKEN/credential
SLACK_CHANNEL_ID: op://kv_app_infra/SLACK_CHANNEL_ID/credential
LINEAR_API_TOKEN: op://kv_app_infra/LINEAR_API_TOKEN/credential
- name: Checkout actions
uses: actions/checkout@v6.0.2
with:
fetch-depth: 1
sparse-checkout: |
.github/actions/setup
- name: Setup
uses: ./.github/actions/setup
with:
token: ${{ steps.load-secrets.outputs.ARABOT_PAT }}
fetch-depth: 0
ref: ${{ inputs.base_commit || 'main' }}
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v7.0.0
with:
gpg_private_key: ${{ steps.load-secrets.outputs.GPG_PRIVATE_KEY }}
passphrase: ${{ steps.load-secrets.outputs.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Generate Release Branch Name
id: branch-name
run: echo "name=release/$(date +'%Y-%m-%d_%H-%M')" >> $GITHUB_OUTPUT
- name: Ensure Release Branch
uses: ./.github/actions/git-ensure-branch
with:
branch: ${{ steps.branch-name.outputs.name }}
base_ref: ${{ inputs.base_commit || 'main' }}
- name: Generate Release Summary
id: release-summary
uses: ./.github/actions/generate-release-summary
with:
linear_api_token: ${{ steps.load-secrets.outputs.LINEAR_API_TOKEN }}
- name: Update version and changelog
uses: ./.github/actions/changeset-version
with:
prettier_changelog: "true"
github_token: ${{ steps.load-secrets.outputs.ARABOT_PAT }}
- name: Get package version
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.3.1
- name: Commit changes
run: |
git add --all
git commit -am "Release v${{ steps.package-version.outputs.current-version}}"
git push origin ${{ steps.branch-name.outputs.name }}
- name: Ensure Pull Request
id: create-pr
uses: ./.github/actions/gh-ensure-pr
with:
base: main
head: ${{ steps.branch-name.outputs.name }}
title: Release v${{ steps.package-version.outputs.current-version }}
body: ${{ steps.release-summary.outputs.summary }}
token: ${{ steps.load-secrets.outputs.ARABOT_PAT }}
- name: Notify Slack
id: slack
if: steps.load-secrets.outputs.SLACK_BOT_TOKEN != ''
uses: ./.github/actions/slack-notify
with:
slack_bot_token: ${{ steps.load-secrets.outputs.SLACK_BOT_TOKEN }}
slack_channel_id: ${{ steps.load-secrets.outputs.SLACK_CHANNEL_ID }}
message: |
🚀 *Release v${{ steps.package-version.outputs.current-version }} Started*
*PR:* ${{ steps.create-pr.outputs.url }}
${{ steps.release-summary.outputs.summary }}
- name: Update PR with Slack TS
if: steps.slack.outputs.ts != ''
uses: ./.github/actions/gh-pr-edit-body
with:
pr_number: ${{ steps.create-pr.outputs.number }}
token: ${{ steps.load-secrets.outputs.ARABOT_PAT }}
body: |
${{ steps.release-summary.outputs.summary }}
<!-- slack_ts: ${{ steps.slack.outputs.ts }} -->