1+ name : Build and Upload Binaries
2+
3+ on :
4+ push :
5+ branches : ["main"]
6+
7+ permissions :
8+ contents : write
9+
10+ env :
11+ CARGO_TERM_COLOR : always
12+ RELEASE_TAG : v1.1.0
13+
14+ jobs :
15+ create_release :
16+ runs-on : ubuntu-latest
17+ outputs :
18+ upload_url : ${{ steps.create_release.outputs.upload_url }}
19+ release_id : ${{ steps.create_release.outputs.id }}
20+ steps :
21+ - uses : actions/checkout@v3
22+ with :
23+ fetch-depth : 0
24+ - name : Create GitHub Release
25+ id : create_release
26+ uses : zendesk/action-create-release@v1
27+ env :
28+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
29+ with :
30+ auto_increment_type : patch
31+ prerelease : false
32+ draft : false
33+ tag_schema : semantic
34+
35+ build :
36+ needs : create_release
37+ runs-on : ${{ matrix.os }}
38+
39+ strategy :
40+ matrix :
41+ os : [ubuntu-latest, ubuntu-24.04-arm, macos-13, macos-latest, windows-latest]
42+ include :
43+ - os : ubuntu-latest
44+ target : x86_64-unknown-linux-gnu
45+ binary_name : helix-cli-linux-amd64
46+ - os : ubuntu-24.04-arm
47+ target : aarch64-unknown-linux-gnu
48+ binary_name : helix-cli-linux-arm64
49+ - os : macos-13
50+ target : x86_64-apple-darwin
51+ binary_name : helix-cli-macos-amd64
52+ - os : macos-latest
53+ target : aarch64-apple-darwin
54+ binary_name : helix-cli-macos-arm64
55+ - os : windows-latest
56+ target : x86_64-pc-windows-msvc
57+ binary_name : helix-cli-windows-amd64.exe
58+
59+ steps :
60+ - uses : actions/checkout@v3
61+
62+ - name : Install OpenSSL, pkg-config, and GCC (Linux only)
63+ if : matrix.os == 'ubuntu-20.04'
64+ run : |
65+ sudo apt-get update
66+ sudo apt-get install -y libssl-dev pkg-config gcc
67+ - name : Set up Rust
68+ uses : actions-rs/toolchain@v1
69+ with :
70+ profile : minimal
71+ toolchain : stable
72+ target : ${{ matrix.target }}
73+ override : true
74+
75+ - name : Build
76+ run : |
77+ cd helix-cli
78+ cargo build --release --target ${{ matrix.target }}
79+ - name : Upload Release Asset
80+ uses : actions/upload-release-asset@v1
81+ with :
82+ upload_url : ${{ needs.create_release.outputs.upload_url }}
83+ asset_path : target/${{ matrix.target }}/release/${{ matrix.os == 'windows-latest' && 'helix.exe' || 'helix' }}
84+ asset_name : ${{ matrix.binary_name }}
85+ asset_content_type : application/octet-stream
86+ env :
87+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments