forked from foxglove/studio
-
Notifications
You must be signed in to change notification settings - Fork 0
220 lines (182 loc) · 6.76 KB
/
post-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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
name: Post Release
# run after releases are published
on:
release:
types: [released]
workflow_dispatch:
inputs:
target_commitish:
description: "Release branch"
tag_name:
description: "Tag name (with 'v' prefix)"
jobs:
bump:
name: Merge release branch
runs-on: ubuntu-20.04
permissions:
contents: write
steps:
- name: Checkout ${{ github.event.release.target_commitish || github.event.inputs.target_commitish }}
uses: actions/checkout@v3
with:
ref: ${{ github.event.release.target_commitish || github.event.inputs.target_commitish }}
lfs: true
- name: Configure git
run: |
git config user.name "Foxglove"
git config user.email "contact@foxglove.dev"
- id: bump-version
uses: foxglove/action-bump-version@v1
with:
version: ${{ github.event.release.tag_name || github.event.inputs.tag_name }}-dev
commit-message: Bump dev
push: true
- name: Merge release into main
uses: octokit/request-action@v2.x
with:
route: POST /repos/{owner}/{repo}/merges
owner: foxglove
repo: studio
base: main
head: ${{ github.event.release.target_commitish || github.event.inputs.target_commitish }}
env:
GITHUB_TOKEN: ${{ secrets.FOXGLOVEBOT_GITHUB_TOKEN }}
apt:
name: Publish apt repo
runs-on: ubuntu-20.04
steps:
- name: Checkout ${{ github.event.release.target_commitish || github.event.inputs.target_commitish }}
uses: actions/checkout@v3
with:
ref: ${{ github.event.release.target_commitish || github.event.inputs.target_commitish }}
token: ${{ secrets.FOXGLOVEBOT_GITHUB_TOKEN }}
lfs: true
- uses: actions/setup-node@v3.5.1
with:
node-version: 16.17
- run: corepack enable yarn
- run: yarn install --immutable
- run: sudo apt-get install -qq aptly
- name: Run gpg1 --import
run: |
echo "$APT_PACKAGING_GPG_KEY" | gpg1 --import
set -x
gpg1 --list-keys
gpg1 --list-secret-keys
env:
APT_PACKAGING_GPG_KEY: ${{ secrets.APT_PACKAGING_GPG_KEY }}
- name: Download release binaries
working-directory: ci/apt
run: yarn ts-node downloadReleases.ts
- name: Build apt repo
working-directory: ci/apt
env:
GPG_KEY: B3D1019140FC8712243A16843134270966E8EFD7
run: |
set -x
aptly -config aptly.conf.json repo create -distribution stable stable
aptly -config aptly.conf.json repo add stable packages/*.deb
aptly -config aptly.conf.json publish -gpg-key="$GPG_KEY" repo stable filesystem:public:studio
- name: Publish apt repo
env:
APT_GITHUB_REPO: https://github.com/foxglove/apt.foxglove.dev
run: |
set -x
git config user.name "Foxglove"
git config user.email "contact@foxglove.dev"
git lfs uninstall --local
sed -i '/filter=lfs/d' .gitattributes
git add ci/apt/public
git status
git commit -m "Publish apt repo"
git subtree split --prefix ci/apt/public --branch apt-gh-pages
git push --no-verify --force "$APT_GITHUB_REPO" apt-gh-pages:gh-pages
npm:
name: Publish to NPM
runs-on: ubuntu-20.04
steps:
- name: Checkout ${{ github.event.release.tag_name || github.event.inputs.tag_name }}
uses: actions/checkout@v3
with:
ref: ${{ github.event.release.tag_name || github.event.inputs.tag_name }}
lfs: true
- uses: actions/setup-node@v3.5.1
with:
node-version: 16.17
registry-url: https://registry.npmjs.org
- run: corepack enable yarn
- run: yarn install --immutable
- run: npm publish ./packages/studio
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- run: npm publish ./packages/studio-base
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
docker:
name: Publish to GHCR
runs-on: ubuntu-20.04
permissions:
contents: read
packages: write
steps:
- name: Checkout ${{ github.event.release.tag_name || github.event.inputs.tag_name }}
uses: actions/checkout@v3
with:
ref: ${{ github.event.release.tag_name || github.event.inputs.tag_name }}
lfs: true
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate Docker tags
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}},value=${{ github.event.release.tag_name || github.event.inputs.tag_name }}
type=semver,pattern={{major}}.{{minor}},value=${{ github.event.release.tag_name || github.event.inputs.tag_name }}
latest
- name: Configure QEMU
uses: docker/setup-qemu-action@v2
- name: Configure Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
snap:
name: Publish snap
runs-on: ubuntu-20.04
steps:
- name: Checkout ${{ github.event.release.tag_name || github.event.inputs.tag_name }}
uses: actions/checkout@v3
with:
ref: ${{ github.event.release.tag_name || github.event.inputs.tag_name }}
token: ${{ secrets.FOXGLOVEBOT_GITHUB_TOKEN }}
lfs: true
- uses: actions/setup-node@v3.5.1
with:
node-version: 16.17
- run: corepack enable yarn
- run: yarn install --immutable
- name: Download release binaries
working-directory: ci/apt
run: yarn ts-node downloadReleases.ts
- run: ls -la ci/apt/packages
# Stip the 'v' prefix from the tag to get just the version
# We need the version without the 'v' prefix to build the snap filename
- run: echo "::set-output name=version::$(echo ${{ github.event.release.tag_name || github.event.inputs.tag_name }} | sed -e 's/^v//')"
id: studio-version
- uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_LOGIN }}
with:
snap: ci/apt/packages/foxglove-studio-${{ steps.studio-version.outputs.version }}-linux-amd64.snap
release: stable