-
Notifications
You must be signed in to change notification settings - Fork 4
102 lines (83 loc) · 3.13 KB
/
release.yml
File metadata and controls
102 lines (83 loc) · 3.13 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
95
96
97
98
99
100
101
102
name: Release
on:
push:
tags:
- '*'
jobs:
build-and-release:
runs-on: macos-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Swift via Homebrew
run: |
brew update
brew install swift
swift --version
- name: Get tag name
id: tag
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Build for Apple Silicon (arm64)
run: |
swift build -c release --product iwx --arch arm64
swift build -c release --product proto-dump --arch arm64
- name: Build for Intel (x86_64)
run: |
swift build -c release --product iwx --arch x86_64
swift build -c release --product proto-dump --arch x86_64
- name: Create universal binaries
run: |
mkdir -p build
lipo -create \
-output build/iwx \
.build/arm64-apple-macosx/release/iwx \
.build/x86_64-apple-macosx/release/iwx
lipo -create \
-output build/proto-dump \
.build/arm64-apple-macosx/release/proto-dump \
.build/x86_64-apple-macosx/release/proto-dump
- name: Verify binaries
run: |
echo "iwx:"
lipo -info build/iwx
echo "proto-dump:"
lipo -info build/proto-dump
- name: Create tarballs
run: |
cd build
tar -czf iwx-${{ steps.tag.outputs.TAG_NAME }}-macos-universal.tar.gz iwx
tar -czf proto-dump-${{ steps.tag.outputs.TAG_NAME }}-macos-universal.tar.gz proto-dump
cd ..
- name: Generate checksums
run: |
cd build
shasum -a 256 *.tar.gz > checksums.txt
cat checksums.txt
cd ..
- name: Create Release
uses: softprops/action-gh-release@v2
if: github.ref_type == 'tag'
with:
files: |
build/*.tar.gz
build/checksums.txt
body: |
## Release ${{ steps.tag.outputs.TAG_NAME }}
### Installation
**macOS (Universal - Intel & Apple Silicon)**
```bash
# For iwx
curl -L -O https://github.com/${{ github.repository }}/releases/download/${{ steps.tag.outputs.TAG_NAME }}/iwx-${{ steps.tag.outputs.TAG_NAME }}-macos-universal.tar.gz
tar -xzf iwx-${{ steps.tag.outputs.TAG_NAME }}-macos-universal.tar.gz
sudo mv iwx /usr/local/bin/
# For proto-dump
curl -L -O https://github.com/${{ github.repository }}/releases/download/${{ steps.tag.outputs.TAG_NAME }}/proto-dump-${{ steps.tag.outputs.TAG_NAME }}-macos-universal.tar.gz
tar -xzf proto-dump-${{ steps.tag.outputs.TAG_NAME }}-macos-universal.tar.gz
sudo mv proto-dump /usr/local/bin/
```
### Checksums
See `checksums.txt` for SHA-256 checksums.
draft: false
prerelease: false