-
Notifications
You must be signed in to change notification settings - Fork 5
100 lines (86 loc) · 2.2 KB
/
Copy pathrelease.yaml
File metadata and controls
100 lines (86 loc) · 2.2 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
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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
test-and-build:
name: Test & Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '^1.24.x'
cache: true
- name: Run tests
run: go test ./...
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
install-only: true
- name: Build snapshot
run: goreleaser release --snapshot --clean
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
retention-days: 1
smoke-test:
name: Smoke Test (${{ matrix.os }})
needs: test-and-build
strategy:
matrix:
include:
- os: ubuntu-latest
platform: linux_amd64
- os: macos-latest
platform: darwin_arm64
- os: macos-latest
platform: darwin_amd64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Run smoke tests
run: |
BINARY=$(find dist -path "*${{ matrix.platform }}*" -name "shipyard" -type f | head -1)
if [[ -z "$BINARY" ]]; then
echo "Binary for ${{ matrix.platform }} not found in dist/"
find dist -type f
exit 1
fi
chmod +x "$BINARY"
./scripts/smoke-test.sh "$BINARY"
release:
name: Release
needs: smoke-test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '^1.24.x'
cache: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}