-
-
Notifications
You must be signed in to change notification settings - Fork 3
131 lines (108 loc) · 3.13 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
name: release
on:
push:
branches:
- "main"
tags:
- "v*"
permissions:
contents: write
id-token: write
packages: write
jobs:
# ------------------------------
goreleaser-check-pkgs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs:
- goreleaser
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
strategy:
matrix:
format:
- deb
- rpm
- apk
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-qemu-action@v3
- uses: actions/cache@v4
with:
path: |
./dist/*.deb
./dist/*.rpm
./dist/*.apk
key: ${{ github.ref }}
- run: task dottie:test:${{ matrix.format }}
# ------------------------------
goreleaser:
runs-on: ubuntu-latest
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: setup-snapcraft
# FIXME: the mkdirs are a hack for https://github.com/goreleaser/goreleaser/issues/1715
run: |
sudo apt-get update
sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
mkdir -p $HOME/.cache/snapcraft/download
mkdir -p $HOME/.cache/snapcraft/stage-packages
- uses: actions/setup-go@v5
with:
go-version: stable
- uses: actions/cache@v4
with:
path: |
./dist/*.deb
./dist/*.rpm
./dist/*.apk
key: ${{ github.ref }}
- uses: actions/cache@v4
with:
path: |
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
save-always: true
restore-keys: |
${{ runner.os }}-go-
- uses: sigstore/cosign-installer@v3.4.0
- uses: anchore/sbom-action/download-syft@v0.15.8
- name: ghcr-login
if: startsWith(github.ref, 'refs/tags/v')
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
# - name: snapcraft-login
# if: startsWith(github.ref, 'refs/tags/v')
# run: snapcraft login
# env:
# SNAPCRAFT_STORE_CREDENTIALS: "${{ secrets.SNAPCRAFT_LOGIN }}"
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
install-only: true
- name: goreleaser-release
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
COSIGN_PWD: ${{ secrets.COSIGN_PWD }}
SNAPCRAFT_STORE_CREDENTIALS: "${{ secrets.SNAPCRAFT_LOGIN }}"
FURY_PUSH_TOKEN: "${{ secrets.FURY_PUSH_TOKEN }}"
run: task goreleaser