-
Notifications
You must be signed in to change notification settings - Fork 488
192 lines (185 loc) · 7.05 KB
/
RELEASE.yml
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
name: RELEASE
on:
push:
tags:
- 'v*'
jobs:
pre_release:
name: Prepare release
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
tag: ${{ steps.tag.outputs.TAG }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get tag
id: tag
run: |
echo "TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
- name: Create GitHub release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ steps.tag.outputs.TAG }} --draft --title ${{ steps.tag.outputs.TAG }}
build_release:
name: Build release
needs: pre_release
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-2022 ]
fail-fast: false
runs-on: ${{ matrix.os }}
# Required to upload release artifacts to GitHub
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Import Secrets
id: secrets
uses: hashicorp/[email protected]
with:
url: ${{ secrets.VAULT_ADDR }}
method: approle
roleId: ${{ secrets.VAULT_ROLE_ID }}
secretId: ${{ secrets.VAULT_SECRET_ID }}
exportEnv: false
secrets: |
secret/data/products/desktop-modeler/ci/sentry SENTRY_AUTH_TOKEN;
secret/data/products/desktop-modeler/ci/sentry SENTRY_DSN;
secret/data/products/desktop-modeler/ci/sentry SENTRY_ORG;
secret/data/products/desktop-modeler/ci/sentry SENTRY_PROJECT;
- name: Build release (Linux)
if: ${{ runner.OS == 'Linux' }}
env:
CSC_LINK: "${{ secrets.CSC_LINK }}"
CSC_KEY_PASSWORD: "${{ secrets.CSC_KEY_PASSWORD }}"
MIXPANEL_TOKEN: "${{ secrets.MIXPANEL_PROJECT_TOKEN }}"
MIXPANEL_STAGE: "prod"
SENTRY_AUTH_TOKEN: "${{ steps.secrets.outputs.SENTRY_AUTH_TOKEN }}"
SENTRY_DSN: "${{ steps.secrets.outputs.SENTRY_DSN }}"
SENTRY_ORG: "${{ steps.secrets.outputs.SENTRY_ORG }}"
SENTRY_PROJECT: "${{ steps.secrets.outputs.SENTRY_PROJECT }}"
UPDATES_SERVER_PRODUCT_NAME: "${{ secrets.UPDATES_SERVER_PRODUCT_NAME }}"
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
NODE_ENV: "production"
run: npm run build -- --linux --publish
- name: Build release (MacOS)
if: ${{ runner.os == 'macOS' }}
env:
APPLE_DEVELOPER_ID: "${{ secrets.APPLE_DEVELOPER_ID }}"
APPLE_DEVELOPER_ID_PASSWORD: "${{ secrets.APPLE_DEVELOPER_ID_PASSWORD }}"
APPLE_TEAM_ID: "${{ secrets.APPLE_TEAM_ID }}"
CSC_LINK: "${{ secrets.CSC_LINK }}"
CSC_KEY_PASSWORD: "${{ secrets.CSC_KEY_PASSWORD }}"
MIXPANEL_TOKEN: "${{ secrets.MIXPANEL_PROJECT_TOKEN }}"
MIXPANEL_STAGE: "prod"
SENTRY_AUTH_TOKEN: "${{ steps.secrets.outputs.SENTRY_AUTH_TOKEN }}"
SENTRY_DSN: "${{ steps.secrets.outputs.SENTRY_DSN }}"
SENTRY_ORG: "${{ steps.secrets.outputs.SENTRY_ORG }}"
SENTRY_PROJECT: "${{ steps.secrets.outputs.SENTRY_PROJECT }}"
UPDATES_SERVER_PRODUCT_NAME: "${{ secrets.UPDATES_SERVER_PRODUCT_NAME }}"
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
NODE_ENV: "production"
run: npm run build -- --mac --publish
- name: Build release (Windows)
if: ${{ runner.os == 'Windows' }}
env:
MIXPANEL_TOKEN: "${{ secrets.MIXPANEL_PROJECT_TOKEN }}"
MIXPANEL_STAGE: "prod"
SENTRY_AUTH_TOKEN: "${{ steps.secrets.outputs.SENTRY_AUTH_TOKEN }}"
SENTRY_DSN: "${{ steps.secrets.outputs.SENTRY_DSN }}"
SENTRY_ORG: "${{ steps.secrets.outputs.SENTRY_ORG }}"
SENTRY_PROJECT: "${{ steps.secrets.outputs.SENTRY_PROJECT }}"
UPDATES_SERVER_PRODUCT_NAME: "${{ secrets.UPDATES_SERVER_PRODUCT_NAME }}"
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
NODE_ENV: "production"
run: npm run build -- --win --publish
post_release:
name: Post release
needs: build_release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# required to compare versions in the
# license book summary
fetch-depth: 0
- name: Install dependencies
run: npm ci
- name: Send license book summary
env:
EMAIL_HOST: "${{ secrets.EMAIL_HOST }}"
EMAIL_PASSWORD: "${{ secrets.EMAIL_PASSWORD }}"
EMAIL_REPLY_TO: "${{ secrets.EMAIL_REPLY_TO }}"
EMAIL_TO: "${{ secrets.EMAIL_TO }}"
EMAIL_USERNAME: "${{ secrets.EMAIL_USERNAME }}"
run: npm run send-license-book-summary
communicate_release:
name: Communicate release
needs:
- pre_release
- build_release
runs-on: ubuntu-latest
# skip for release candidates
if: contains(needs.pre_release.outputs.tag, 'rc') == false
steps:
- name: Import Secrets
id: secrets
uses: hashicorp/[email protected]
with:
url: ${{ secrets.VAULT_ADDR }}
method: approle
roleId: ${{ secrets.VAULT_ROLE_ID }}
secretId: ${{ secrets.VAULT_SECRET_ID }}
exportEnv: false
secrets: |
secret/data/products/desktop-modeler/ci/slack_integration SUPPORT_SLACK_CHANNEL_ID;
secret/data/products/desktop-modeler/ci/slack_integration SLACK_BOT_TOKEN;
- name: Get changelog link
id: changelog
run: |
VERSION="$(echo ${{ needs.pre_release.outputs.tag }} | sed 's/v//' | tr -d '.')"
echo "LINK=https://github.com/camunda/camunda-modeler/blob/develop/CHANGELOG.md#$VERSION" >> $GITHUB_OUTPUT
- name: Get milestone link
id: milestone
env:
GH_TOKEN: ${{ github.token }}
run: |
# Fetch the list of milestones for the repository
# Filter for milestones that start with 'M' and are open
MILESTONE=$(gh api -H "Accept: application/vnd.github.v3+json" \
/repos/${{ github.repository }}/milestones \
--jq '[.[] | select(.title | startswith("M")) | .number ][0]'
)
echo "LINK=https://github.com/camunda/camunda-modeler/issues?q=is%3Aissue+label%3Achannel%3Asupport+milestone%3A$MILESTONE" >> $GITHUB_OUTPUT
- name: Post to a Slack channel
uses: slackapi/slack-github-action@v2
with:
method: chat.postMessage
token: ${{ steps.secrets.outputs.SLACK_BOT_TOKEN }}
payload: |
channel: ${{ steps.secrets.outputs.SUPPORT_SLACK_CHANNEL_ID }}
blocks:
- type: section
text:
type: plain_text
text: '[fyi] Hi, Desktop Modeler ${{ needs.pre_release.outputs.tag }} release is upcoming. Contact @desktop-modeler-release-manager in case of any questions.'
- type: section
text:
type: mrkdwn
text: '${{ steps.changelog.outputs.LINK }}|Changelog>'
- type: section
text:
type: mrkdwn
text: '<${{ steps.milestone.outputs.LINK }}|Closed issues related to support>'