Repository navigation
94 lines (81 loc) · 2.98 KB
/
Copy pathrelease.yml
File metadata and controls
94 lines (81 loc) · 2.98 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
90
91
92
93
94
name: Release binaries
# Builds Linux, OSX and Windows binaries and publishes them to a rolling
# 'latest' release on every push to main. Pushing a v* tag additionally
# creates a versioned release.
#
# Download links:
# https://github.com/orbcode/orbuculum/releases/download/latest/orbuculum-linux.tar.gz
# https://github.com/orbcode/orbuculum/releases/download/latest/orbuculum-osx.tar.gz
# https://github.com/orbcode/orbuculum/releases/download/latest/orbuculum-win64.zip
on:
push:
branches:
- main
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true
jobs:
linux:
uses: ./.github/workflows/build-linux.yml
osx:
uses: ./.github/workflows/build-osx.yml
windows:
uses: ./.github/workflows/build-windows.yml
release:
needs: [linux, osx, windows]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: dist
- name: Package
working-directory: dist
run: |
# Artifacts lose the executable bit; restore it on binaries
for p in orbuculum-linux orbuculum-osx; do
find "$p" -path '*/bin/*' -type f -exec chmod +x {} +
tar -czf "$p.tar.gz" -C "$p" .
done
(cd orbuculum-win64 && zip -r ../orbuculum-win64.zip .)
ls -l *.tar.gz *.zip
- name: Write release notes
run: |
cat > notes.md <<'NOTES'
## Runtime dependencies
**Windows (`orbuculum-win64.zip`)** - self-contained; all required DLLs are in `bin/`.
**Linux (`orbuculum-linux.tar.gz`)** - built on Ubuntu (latest LTS). Install:
```
sudo apt install libusb-1.0-0 libzmq5 libsdl2-2.0-0 libdw1 libelf1 libcapstone5
```
**macOS (`orbuculum-osx.tar.gz`)** - built on macOS 15 (Apple Silicon). Install:
```
brew install libusb zmq sdl2 libelf
```
NOTES
sed -i 's/^ //' notes.md
- name: Update 'latest' release
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
git_sha=${{ github.sha }}
gh release delete latest --yes --cleanup-tag || true
gh release create latest dist/*.tar.gz dist/*.zip \
--target "$git_sha" \
--prerelease \
--title "Latest build (${git_sha:0:7})" \
--notes "$(printf 'Automated build of %s from %s.\n\n' "$git_sha" "$GITHUB_REF_NAME"; cat notes.md)"
- name: Create versioned release
if: startsWith(github.ref, 'refs/tags/v')
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
gh release create "$GITHUB_REF_NAME" dist/*.tar.gz dist/*.zip \
--title "$GITHUB_REF_NAME" --notes-file notes.md --generate-notes