-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (73 loc) · 2.19 KB
/
Copy pathrelease.yaml
File metadata and controls
84 lines (73 loc) · 2.19 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
---
name: Release artifacts
on:
release:
types: [published]
workflow_dispatch:
env:
CI: true
permissions:
contents: write
jobs:
dist:
name: Build and attach dist artifacts
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout release ref
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Resolve version from release tag
id: version
run: |
set -e
version="${{ github.event.release.tag_name }}"
if [ -z "$version" ]; then
version="$(git describe --tags --exact-match 2>/dev/null || git rev-parse --short HEAD)"
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Build dist matrix
run: make dist VERSION="${{ steps.version.outputs.version }}"
- name: Smoke linux artifact
run: |
set -e
version="${{ steps.version.outputs.version }}"
tar -xzf "dist/facts-${version}-linux-amd64.tar.gz" -C /tmp
got="$(/tmp/facts-${version}-linux-amd64/facts --version)"
test "$got" = "$version"
- name: Upload dist artifacts
uses: actions/upload-artifact@v4
with:
name: facts-dist
path: |
dist/facts-*.tar.gz
dist/facts-*.zip
dist/SHA256SUMS
- name: Attach artifacts and checksums to release
if: github.event_name == 'release'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release upload "${{ github.event.release.tag_name }}" \
dist/facts-*.tar.gz \
dist/facts-*.zip \
dist/SHA256SUMS \
--clobber
bump-tap:
name: Bump Homebrew tap formula
needs: dist
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- name: Bump formula in ncode/homebrew-tap
uses: dawidd6/action-homebrew-bump-formula@v3
with:
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
tap: ncode/homebrew-tap
formula: facts
tag: ${{ github.event.release.tag_name }}
force: false