-
Notifications
You must be signed in to change notification settings - Fork 45
76 lines (61 loc) · 1.85 KB
/
release.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
name: release
on:
push:
branches:
- main
paths:
- go.mod
- go.sum
- '**.go'
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
- name: Git Config for Unit Tests
run: |
git config --global user.email ci
git config --global user.name ci
git config --global init.defaultBranch main
- name: Run Unit Tests
run: |
make test
- name: Build binary
run: |
make build
chmod +x ./autotag/autotag
- name: Autotag Merge Commit
# TODO: replace this with GitHub Action after #41
run: |
./autotag/autotag
echo "tags:" && git tag -l
- name: Install rpm
run: |
sudo apt-get -qqy update && sudo apt-get -qqy install rpm
# setup qemu and buildx for cross-builds (arm64)
- name: Set up QEMU (for arm64 builds)
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3
# finally run goreleaser to build and publish all artifacts:
- name: Deploy Autotag Release
# TODO(vtopc): switch to the `goreleaser/goreleaser-action` GHA?
run: |
curl -sL https://git.io/goreleaser | bash -s -- --parallelism=2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}