-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (43 loc) · 1.66 KB
/
release-artifacts.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
on:
push:
tags:
- '*'
env:
SOURCE_REPO: argus
name: release
jobs:
release-artifacts:
runs-on: [ARM64, self-hosted, Linux]
steps:
# See https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow
# For why we need to generate a token and not use the default
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.CZI_RELEASE_PLEASE_APP_ID }}
private_key: ${{ secrets.CZI_RELEASE_PLEASE_PK }}
# clone the artifact repo
- uses: actions/checkout@v4
with:
token: ${{ steps.generate_token.outputs.token }}
path: ${{ github.event.repository.name }}
# clone the source repo
- uses: actions/checkout@v4
with:
token: ${{ steps.generate_token.outputs.token }}
repository: chanzuckerberg/${{ env.SOURCE_REPO }}
# we need to clone the source repo into a directory within the artifact repo so that goreleaser will build the source but use the tag from the artifact repo
path: ${{ github.event.repository.name }}/core/cli/${{ env.SOURCE_REPO }}
- uses: actions/setup-go@v5
with:
go-version-file: ${{ github.event.repository.name }}/core/cli/${{ env.SOURCE_REPO }}/core/go.mod
cache: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
workdir: ${{ github.event.repository.name }}/core/cli/
args: release --clean
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}