-
Notifications
You must be signed in to change notification settings - Fork 20
89 lines (77 loc) · 2.14 KB
/
Copy pathci.yml
File metadata and controls
89 lines (77 loc) · 2.14 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
name: CI
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: make test
build:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build doubletake
run: make doubletake-release
- name: Build doubletake-ctl
run: make doubletake-ctl-release
- name: Build doubletake-test-receiver
run: make doubletake-test-receiver-release
- name: Bundle manpages
run: make manpages-release
- uses: actions/upload-artifact@v4
with:
name: release-assets
path: |
doubletake
doubletake-ctl
doubletake-test-receiver
doubletake-manpages.tar.gz
release:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- uses: actions/download-artifact@v4
with:
name: release-assets
- name: Extract release notes from tag
id: notes
run: |
# Re-fetch the tag to ensure the annotated tag object is present
git fetch origin tag "${GITHUB_REF_NAME}" --force --no-tags
NOTES=$(git tag -l --format='%(contents)' "${GITHUB_REF_NAME}")
if [ -z "$NOTES" ]; then
NOTES=$(git log -1 --format='%B' "${GITHUB_REF_NAME}")
fi
{
echo 'RELEASE_NOTES<<EOF'
echo "$NOTES"
echo 'EOF'
} >> "$GITHUB_OUTPUT"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.notes.outputs.RELEASE_NOTES }}
files: |
doubletake
doubletake-ctl
doubletake-test-receiver
doubletake-manpages.tar.gz