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: Release
on:
push:
tags:
workflow_dispatch:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
package:
strategy:
matrix:
include:
- runner: ubuntu-latest
arch: amd64
- runner: ubuntu-24.04-arm
arch: arm64
runs-on: ${{ matrix.runner }}
steps:
# Full history: the Makefile derives the package version from the tag.
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Build .deb
run: make deb DEB_ARCH=${{ matrix.arch }}
- name: Name the bare binary
run: |
version=$(grep '^version' Cargo.toml | head -1 | cut -d'"' -f2)
cp "target/dist/${{ matrix.arch }}/fslog" "fslog-$version-linux-${{ matrix.arch }}"
- uses: actions/upload-artifact@v7
with:
name: fslog-${{ matrix.arch }}
path: |
*.deb
fslog-*-linux-*
if-no-files-found: error
release:
needs: package
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/download-artifact@v8
with:
path: assets
merge-multiple: true
- name: Check tag matches Cargo.toml version
run: |
version=$(grep '^version' Cargo.toml | head -1 | cut -d'"' -f2)
if [ "$GITHUB_REF_NAME" != "v$version" ]; then
echo "tag $GITHUB_REF_NAME does not match Cargo.toml version $version" >&2
exit 1
fi
echo "VERSION=$version" >> "$GITHUB_ENV"
- name: Source tarball and checksums
run: |
git archive --format=tar.gz \
--prefix="freeswitch-log-parser-$VERSION/" \
-o "assets/freeswitch-log-parser-$VERSION.tar.gz" "$GITHUB_REF_NAME"
cd assets
sha256sum fslog-* *.deb *.tar.gz > SHA256SUMS
# The annotated tag's message is the changelog the release process writes.
# `contents:body` drops the subject line (already the title) and, on a signed
# tag, the PGP block that `contents` would paste into the release notes.
- name: Create release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "$GITHUB_REF_NAME" \
--title "$GITHUB_REF_NAME" \
--notes "$(git tag -l --format='%(contents:body)' "$GITHUB_REF_NAME")" \
assets/*