-
Notifications
You must be signed in to change notification settings - Fork 9
81 lines (66 loc) · 2.42 KB
/
release.yml
File metadata and controls
81 lines (66 loc) · 2.42 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
name: Release
on:
push:
tags:
- "v*"
# Handles tags created via the GitHub UI (no git push event)
create:
# Allow running from the GitHub UI
workflow_dispatch:
permissions:
contents: write
jobs:
release:
# Only run for v* tag pushes, tag creations, or manual dispatch
if: >-
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) ||
(github.event_name == 'create' && github.ref_type == 'tag' && startsWith(github.ref, 'v')) ||
(github.event_name == 'workflow_dispatch')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history for changelog
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
aur:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Extract version from tag
id: version
run: echo "pkgver=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Update PKGBUILD version and checksums
run: |
cd aur
PKGVER="${{ steps.version.outputs.pkgver }}"
TAG="v${PKGVER}"
# Update pkgver
sed -i "s/^pkgver=.*/pkgver=${PKGVER}/" PKGBUILD
# Download release tarballs and compute checksums
BASE_URL="https://github.com/ssp-data/neomd/releases/download/${TAG}"
curl -sL "${BASE_URL}/neomd_${PKGVER}_linux_amd64.tar.gz" -o amd64.tar.gz
curl -sL "${BASE_URL}/neomd_${PKGVER}_linux_arm64.tar.gz" -o arm64.tar.gz
SHA_AMD64=$(sha256sum amd64.tar.gz | cut -d' ' -f1)
SHA_ARM64=$(sha256sum arm64.tar.gz | cut -d' ' -f1)
sed -i "s/^sha256sums_x86_64=.*/sha256sums_x86_64=('${SHA_AMD64}')/" PKGBUILD
sed -i "s/^sha256sums_aarch64=.*/sha256sums_aarch64=('${SHA_ARM64}')/" PKGBUILD
rm -f amd64.tar.gz arm64.tar.gz
cat PKGBUILD
- name: Publish to AUR
uses: KSXGitHub/github-actions-deploy-aur@v4.1.2
with:
pkgname: neomd-bin
pkgbuild: aur/PKGBUILD
commit_username: Simon Späti
commit_email: simon@ssp.sh
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: "Update to ${{ steps.version.outputs.pkgver }}"