Repository navigation
75 lines (64 loc) · 1.69 KB
/
Copy pathrelease.yml
File metadata and controls
75 lines (64 loc) · 1.69 KB
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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: read
jobs:
packages:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64, arm64]
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
- name: Set version from tag
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV"
- name: Build binary
env:
CGO_ENABLED: '0'
GOOS: linux
GOARCH: ${{ matrix.arch }}
run: go build -trimpath -o https-dns-proxy .
- name: Install nfpm
env:
GOTOOLCHAIN: auto
run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.47.0
- name: Package deb and rpm
env:
VERSION: ${{ env.VERSION }}
ARCH: ${{ matrix.arch }}
run: |
for p in deb rpm; do
nfpm package -p "$p" -f nfpm.yaml -t "https-dns-proxy_${VERSION}_${ARCH}.$p"
done
- name: Upload packages
uses: actions/upload-artifact@v7
with:
name: packages-${{ matrix.arch }}
path: |
*.deb
*.rpm
release:
needs: packages
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download packages
uses: actions/download-artifact@v8
with:
pattern: packages-*
merge-multiple: true
path: dist
- name: Publish GitHub release
uses: softprops/action-gh-release@8a0cd651e5b2365bd640854a3fa5dfc70e4875f3 # v3.0.4
with:
files: dist/*
generate_release_notes: true