-
Notifications
You must be signed in to change notification settings - Fork 255
141 lines (121 loc) · 5.6 KB
/
release-generation.yaml
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
name: "Release - Generation"
on:
# release:
# types: [created]
push:
branches:
- distro-255-aa-fix-release-workflow
env:
# Example: 8.4+gen1
CAMUNDA_RELEASE_NAME: 8.4+gen7
jobs:
release_script:
runs-on: ubuntu-latest
name: Build release notes
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.20"
- name: Build
working-directory: ./release-notes-fetcher
run: go build
- name: Generate token for Camunda GitHub org
id: generate-camunda-github-token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Generate token for Camunda Cloud GitHub org
id: generate-camunda-cloud-github-token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
repository: camunda-cloud/identity
- name: Set vars
run: |
CAMUNDA_VERSION="$(echo ${CAMUNDA_RELEASE_NAME} | awk -F '+' '{print $1}')"
CONFIG_FILE="release-notes-fetcher/config/release-notes-fetcher-camunda-${CAMUNDA_VERSION}.yaml"
export GLOBAL_GITREF="$(yq '.gitRef.global' ${CONFIG_FILE})"
# Generate env var from git ref for all apps.
# This will generate env vars like "ZEEBE_GITREF".
yq '.gitRef | omit(["global"]) | keys' "${CONFIG_FILE}" | sed 's/- //g' |
while read APP_NAME; do
APP_REF="$(APP_NAME=${APP_NAME} yq '.gitRef.[env(APP_NAME)] // env(GLOBAL_GITREF)' ${CONFIG_FILE})"
echo "${APP_NAME^^}_GITREF=${APP_REF}" >> "${GITHUB_ENV}"
done
- name: Run release notes script
working-directory: ./release-notes-fetcher
run: set -o pipefail; ./release-notes-fetcher | tee release_notes.txt
env:
GITHUB_CAMUNDA_ACCESS_TOKEN: ${{ steps.generate-camunda-github-token.outputs.token }}
GITHUB_CAMUNDA_CLOUD_ACCESS_TOKEN: ${{ steps.generate-camunda-cloud-github-token.outputs.token }}
- name: Login to gh repo
working-directory: ./release-notes-fetcher
run: echo ${{ steps.generate-camunda-github-token.outputs.token }} | gh auth login --with-token
- name: Edit release notes with output from script
working-directory: ./release-notes-fetcher
run: gh release edit --notes-file release_notes.txt -R camunda/camunda-platform ${CAMUNDA_RELEASE_NAME}
- name: Create temporary directory for asset download/upload
working-directory: ./release-notes-fetcher
run: mkdir -p tmp
# Tasklist binaries are uploaded to zeebes repo
- name: Download Zeebe resources
working-directory: ./release-notes-fetcher/tmp
run: |
gh release download "${ZEEBE_GITREF}" \
-R camunda/zeebe \
-p "zbctl" \
-p "zbctl.sha1sum" \
-p "zbctl.exe" \
-p "zbctl.exe.sha1sum" \
-p "zbctl.darwin" \
-p "zbctl.darwin.sha1sum" \
-p "camunda-zeebe-${ZEEBE_GITREF}.tar.gz" \
-p "camunda-zeebe-${ZEEBE_GITREF}.tar.gz.sha1sum" \
-p "camunda-zeebe-${ZEEBE_GITREF}.zip" \
-p "camunda-zeebe-${ZEEBE_GITREF}.zip.sha1sum" \
-p "camunda-tasklist-${ZEEBE_GITREF}.zip" \
-p "camunda-tasklist-${ZEEBE_GITREF}.zip.sha1sum" \
-p "camunda-tasklist-${ZEEBE_GITREF}.tar.gz" \
-p "camunda-tasklist-${ZEEBE_GITREF}.tar.gz.sha1sum"
- name: Download Operate resources from monorepo
if: ${{ startsWith(env.CAMUNDA_RELEASE_NAME, '8.5') }}
working-directory: ./release-notes-fetcher/tmp
run: |
gh release download "operate-${OPERATE_GITREF}" \
-R camunda/zeebe \
-p "camunda-operate-${OPERATE_GITREF}.zip" \
-p "camunda-operate-${OPERATE_GITREF}.zip.sha1sum" \
-p "camunda-operate-${OPERATE_GITREF}.tar.gz" \
-p "camunda-operate-${OPERATE_GITREF}.tar.gz.sha1sum" \
- name: Download Operate resources
if: ${{ !startsWith(env.CAMUNDA_RELEASE_NAME, '8.5') }}
working-directory: ./release-notes-fetcher/tmp
run: |
gh release download "${OPERATE_GITREF}" \
-R camunda/operate \
-p "camunda-operate-${OPERATE_GITREF}.zip" \
-p "camunda-operate-${OPERATE_GITREF}.zip.sha1sum" \
-p "camunda-operate-${OPERATE_GITREF}.tar.gz" \
-p "camunda-operate-${OPERATE_GITREF}.tar.gz.sha1sum" \
- name: Login to Camunda Cloud
working-directory: ./release-notes-fetcher
run: echo ${{ steps.generate-camunda-cloud-github-token.outputs.token }} | gh auth login --with-token
- name: Download Identity resources
working-directory: ./release-notes-fetcher/tmp
run: |
gh release download "${IDENTITY_GITREF}" \
-R camunda-cloud/identity \
-p "camunda-identity-${IDENTITY_GITREF}.tar.gz" \
-p "camunda-identity-${IDENTITY_GITREF}.tar.gz.sha1sum" \
-p "camunda-identity-${IDENTITY_GITREF}.zip" \
-p "camunda-identity-${IDENTITY_GITREF}.zip.sha1sum"
- name: Login back to Camunda
working-directory: ./release-notes-fetcher
run: echo ${{ steps.generate-camunda-github-token.outputs.token }} | gh auth login --with-token
- name: Upload resources
working-directory: ./release-notes-fetcher/tmp
run: gh release -R camunda/camunda-platform upload "${CAMUNDA_RELEASE_NAME}" *