Repository navigation
83 lines (70 loc) · 2.55 KB
/
Copy pathrelease.yml
File metadata and controls
83 lines (70 loc) · 2.55 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
name: Release
# Tagging a version (git tag v1) builds the five packages and puts them on
# the Releases page.
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: stable
# build.sh is the same script used to build by hand, called rather
# than copied. It already checks formatting, runs vet and runs the
# tests before compiling anything, so none of that is repeated here.
# GITHUB_REF_NAME is the tag, and it is what "customs --version" ends
# up printing.
- name: Build the packages
run: |
sh build.sh
ls -lh dist/*.zip dist/*.tar.gz
# The release text comes from CHANGELOG.md, from the section whose
# heading matches this tag exactly. No section, no notes: better than
# the same generic paragraph on every version.
- name: Prepare the release notes
run: |
if [ -f CHANGELOG.md ]; then
awk -v wanted="## $GITHUB_REF_NAME" '
$0 == wanted { inside = 1; next }
/^## / { inside = 0 }
inside { print }
' CHANGELOG.md > notes.md
fi
touch notes.md
cat >> notes.md <<'END'
## Download
Take the package for your system, unpack it, and run the binary.
There is nothing to install.
| System | Package |
|---|---|
| Windows | `customs-windows.zip` |
| Linux | `customs-linux.tar.gz` |
| Linux on ARM | `customs-linux-arm.tar.gz` |
| Mac with Apple silicon | `customs-mac-apple.tar.gz` |
| Mac with Intel | `customs-mac-intel.tar.gz` |
Point it at what you are about to run: an install script, a
package.json, a Makefile, a Dockerfile, a systemd unit. It says
what happens while it runs and, separately, what is still true
tomorrow, which is the half nobody reads for.
It never runs any of it, it never opens a socket, and it never
prints a credential.
END
echo "--- notes ---"
cat notes.md
- name: Publish
uses: softprops/action-gh-release@v3
with:
files: |
dist/customs-windows.zip
dist/customs-linux.tar.gz
dist/customs-linux-arm.tar.gz
dist/customs-mac-apple.tar.gz
dist/customs-mac-intel.tar.gz
body_path: notes.md