Skip to content

Commit 7b8d3c3

Browse files
committed
ci: build release binaries and upload as artifacts
Add Makefile with build, install, and release targets.
1 parent 11afc3a commit 7b8d3c3

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ jobs:
2121
- name: Test
2222
run: swift test
2323

24+
- name: Build release
25+
run: swift build --configuration release
26+
27+
- name: Upload binary
28+
uses: actions/upload-artifact@v4
29+
with:
30+
name: mtpx-macos-arm64
31+
path: .build/release/mtpx
32+
2433
build-and-test-linux:
2534
runs-on: ubuntu-24.04
2635
container: swift:6.2-noble
@@ -35,3 +44,12 @@ jobs:
3544

3645
- name: Test
3746
run: swift test
47+
48+
- name: Build release
49+
run: swift build --configuration release
50+
51+
- name: Upload binary
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: mtpx-linux-amd64
55+
path: .build/release/mtpx

Makefile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
prefix ?= /usr/local
2+
bindir = $(prefix)/bin
3+
4+
version := $(shell git describe --tags 2>/dev/null || echo dev)
5+
6+
.PHONY: build
7+
build:
8+
swift build --configuration release
9+
10+
.PHONY: install
11+
install: build
12+
install -d "$(bindir)"
13+
install ".build/release/mtpx" "$(bindir)"
14+
15+
.PHONY: uninstall
16+
uninstall:
17+
rm -f "$(bindir)/mtpx"
18+
19+
.PHONY: release
20+
release: release/mtpx-$(version).tar.bz2
21+
22+
release/mtpx-$(version).tar.bz2: build
23+
mkdir -p release
24+
tar --create --bzip2 --file release/mtpx-$(version).tar.bz2 --directory .build/release mtpx
25+
26+
.PHONY: clean
27+
clean:
28+
rm -rf release

0 commit comments

Comments
 (0)