-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (71 loc) · 2.37 KB
/
Copy pathrelease.yml
File metadata and controls
83 lines (71 loc) · 2.37 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 init script packages
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set version
run: |
v="${GITHUB_REF_NAME#v}"
echo "VERSION=${v//-/\~}" >> "$GITHUB_ENV"
- name: Render per-board nfpm configs
run: for b in j80 j100 j200 j310; do sed "s/@BOARD@/$b/g" .github/nfpm.yaml > "nfpm-$b.yaml"; done
- name: Build armbian .deb (j80)
uses: secondlife/action-nfpm@v2
with:
checkout: false
packager: deb
config: nfpm-j80.yaml
target: build/j80
- name: Build armbian .deb (j100)
uses: secondlife/action-nfpm@v2
with:
checkout: false
packager: deb
config: nfpm-j100.yaml
target: build/j100
- name: Build armbian .deb (j200)
uses: secondlife/action-nfpm@v2
with:
checkout: false
packager: deb
config: nfpm-j200.yaml
target: build/j200
- name: Build armbian .deb (j310)
uses: secondlife/action-nfpm@v2
with:
checkout: false
packager: deb
config: nfpm-j310.yaml
target: build/j310
- name: Assemble release assets
run: |
mkdir -p dist
for b in j80 j100 j200 j310; do
mv "build/$b"/*.deb "dist/jethub-init-${b}_${VERSION}.deb"
done
# Reproducible, so a rebuilt release asset keeps the hash HAOS pins
tar --sort=name --format=gnu --owner=0 --group=0 --numeric-owner --mode=go-w \
--mtime="@$(git log -1 --format=%ct)" --transform "s,^,jethub-init-${VERSION}/," \
-cf - j80 j100 j200 j310 | gzip -9n > "dist/jethub-init-haos_${VERSION}.tar.gz"
- name: Publish release
env:
GH_TOKEN: ${{ github.token }}
run: |
# The release already exists when it was created in the GitHub UI
if gh release view "$GITHUB_REF_NAME" >/dev/null 2>&1; then
gh release upload "$GITHUB_REF_NAME" dist/* --clobber
else
gh release create "$GITHUB_REF_NAME" dist/* \
--title "$GITHUB_REF_NAME" \
--generate-notes
fi
- name: Cleanup workspace
if: always()
run: rm -rf dist build nfpm-*.yaml