generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 7
202 lines (198 loc) · 6.44 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
193
194
195
196
197
198
199
200
201
202
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
name: Automatically Build Release
jobs:
docker-shard:
name: Shard Docker Builds
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- id: set-matrix
name: Shard Docker Builds
uses: ./.github/actions/shard-docker-builds
build-docker-images:
name: Build ${{ matrix.service }} Docker Image
needs: docker-shard
runs-on: ubuntu-latest
strategy:
matrix:
service: ${{ fromJson(needs.docker-shard.outputs.matrix) }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Init Hermit
uses: cashapp/[email protected]
- name: Build Image and Save
uses: ./.github/actions/save-docker-image
with:
service: ${{ matrix.service }}
release-docker:
name: Release Docker Images
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs: build-docker-images
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Init Hermit
uses: cashapp/[email protected]
- name: Load Docker Images
uses: ./.github/actions/load-docker-images
- name: Log in to Container registry
uses: docker/login-action@v3
with:
username: ftl0
password: ${{ secrets.FTL_DOCKER_PUSH_TOKEN }}
- name: Push Docker Images
run: |
version="$(git describe --tags --abbrev=0)"
for image in $(just list-docker-images); do
docker tag "ftl0/ftl-${image}:latest" "ftl0/ftl-${image}:${GITHUB_SHA}"
docker tag "ftl0/ftl-${image}:latest" "ftl0/ftl-${image}:${version}"
docker push -a "ftl0/ftl-${image}"
done
create-go-release:
name: Release Go Binaries
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Init Hermit
uses: cashapp/[email protected]
- name: Build Cache
uses: ./.github/actions/build-cache
- name: Build Console
run: just build-frontend
- name: Publish Go Binaries
run: |
just errtrace
just build ftl # Ensure all the prerequisites are built before we use goreleaser
just build-language-plugins
goreleaser release --skip=validate
env:
GITHUB_TOKEN: ${{ github.token }}
FTL_HOMEBREW_TOKEN: ${{ secrets.FTL_HOMEBREW_TOKEN }}
create-jvm-releases:
name: Release JVM Artifacts
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Init Hermit
uses: cashapp/[email protected]
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set Version
working-directory: ./jvm-runtime/ftl-runtime
run: mvn versions:set -DnewVersion="$(echo ${{ github.ref_name }} | sed s/v//)"
- name: Build, Test, and Deploy to Maven Central
working-directory: ./jvm-runtime/ftl-runtime
run: |
# Maven deploy lifecycle will build, run tests, verify, sign, and deploy
mvn \
deploy \
-P ossrh,release \
--batch-mode \
--settings .maven_settings.xml
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SIGN_KEY_PASS: ${{ secrets.GPG_SECRET_PASSPHRASE }}
SIGN_KEY: ${{ secrets.GPG_SECRET_KEY }}
hermit-release:
name: Release Hermit
runs-on: ubuntu-latest
needs: [create-go-release]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
repository: TBD54566975/hermit-ftl
ref: "main"
token: ${{ secrets.FTL_HERMIT_AUTOVERSION }}
- name: Init Hermit
uses: cashapp/[email protected]
- name: Setup Git Config
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Auto-version
run: |
hermit manifest auto-version ftl.hcl --update-digests
- name: Commit and Push
run: |
git add ftl.hcl
git commit -m "Auto-versioned"
git push origin main
vscode-release:
name: Release VSCode Extension
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Init Hermit
uses: cashapp/[email protected]
- name: Publish
run: |
set -euo pipefail
version="$(git describe --tags --abbrev=0 | sed 's/^v//')"
echo "Publishing version $version"
jq --arg version "$version" '.version = $version' frontend/vscode/package.json > frontend/vscode/package.json.tmp
mv frontend/vscode/package.json.tmp frontend/vscode/package.json
just publish-extension
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
helm-release:
name: Release Helm Charts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: "Checkout Charts Repository"
with:
repository: "${{ github.repository_owner }}/ftl-charts"
token: "${{ secrets.FTL_CHARTS_TOKEN }}"
fetch-depth: 0
- name: Checkout FTL
uses: actions/checkout@v4
with:
fetch-depth: 0
path: .ftl
- name: Init Hermit
uses: cashapp/[email protected]
with:
working-directory: ".ftl"
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
git config pull.rebase true
- name: Sync Charts to Charts Repository
run: |
cd .ftl
version="$(git describe --tags --abbrev=0 | sed 's/v//')"
just chart set-version "$version"
cd ..
rm -rf charts/
cp -r .ftl/charts/ charts/
git add charts
git commit -a -m "Update charts"
git push