-
Notifications
You must be signed in to change notification settings - Fork 33
111 lines (104 loc) · 2.97 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
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
name: release
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
jobs:
build-linux-binary:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v3
with:
go-version: 1.18
cache: true
- uses: goreleaser/goreleaser-action@v4
with:
# either 'goreleaser' (default) or 'goreleaser-pro':
distribution: goreleaser
version: latest
args: release --skip-publish --config .goreleaser-linux.yaml
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
- name: Upload
uses: actions/upload-artifact@v3
with:
name: birdwatcher-linux
path: |
dist/birdwatcher*
dist/checksums.txt
build-darwin-binary:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v3
with:
go-version: 1.18
cache: true
- uses: goreleaser/goreleaser-action@v4
with:
# either 'goreleaser' (default) or 'goreleaser-pro':
distribution: goreleaser
version: latest
args: release --skip-publish --config .goreleaser-darwin.yaml
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
- name: Upload
uses: actions/upload-artifact@v3
with:
name: birdwatcher-darwin
path: |
dist/birdwatcher*
dist/checksums.txt
merge-and-release:
needs: [build-linux-binary, build-darwin-binary]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v3
with:
go-version: 1.18
cache: true
- name: Make directories
run: |
mkdir -p ./birdwatcher-build/linux
mkdir -p ./birdwatcher-build/darwin
- name: Download linux binaries
uses: actions/download-artifact@v3
with:
name: birdwatcher-linux
path: ./birdwatcher-build/linux
- name: Download darwin binaries
uses: actions/download-artifact@v3
with:
name: birdwatcher-darwin
path: ./birdwatcher-build/darwin
- name: Merge checksum file
run: |
cd ./birdwatcher-build
cat ./darwin/checksums.txt >> checksums.txt
cat ./linux/checksums.txt >> checksums.txt
rm ./darwin/checksums.txt
rm ./linux/checksums.txt
- name: Check git status
run: |
tree
git status
- name: Release
uses: goreleaser/goreleaser-action@v4
with:
args: release --clean --config .goreleaser-release.yaml
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}