Release Binaries #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Binaries | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
build-release: | |
name: Build Release | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-musl | |
artifact_name: rustygate-linux-amd64 | |
- os: ubuntu-latest | |
target: aarch64-unknown-linux-musl | |
artifact_name: rustygate-linux-arm64 | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
artifact_name: rustygate-darwin-amd64 | |
- os: macos-latest | |
target: aarch64-apple-darwin | |
artifact_name: rustygate-darwin-arm64 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.target }} | |
- name: Install dependencies (Ubuntu) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y musl-tools | |
# Install OpenSSL for musl | |
sudo apt-get install -y musl-dev | |
sudo apt-get install -y pkg-config | |
sudo apt-get install -y linux-headers-generic | |
wget https://www.openssl.org/source/openssl-3.0.8.tar.gz | |
tar xf openssl-3.0.8.tar.gz | |
cd openssl-3.0.8 | |
# Modified Configure options | |
CC="musl-gcc -fPIC" ./Configure no-shared no-async --prefix=/usr/local/musl --openssldir=/usr/local/musl no-comp no-idea no-mdc2 no-rc5 no-ec2m no-sm2 no-sm4 no-secure-memory linux-x86_64 | |
make -j$(nproc) | |
sudo make install | |
echo "OPENSSL_DIR=/usr/local/musl" >> $GITHUB_ENV | |
echo "OPENSSL_STATIC=1" >> $GITHUB_ENV | |
- name: Build binary | |
run: | | |
cargo build --release --target ${{ matrix.target }} | |
cp target/${{ matrix.target }}/release/main ${{ matrix.artifact_name }} | |
- name: Generate SHA256 | |
run: | | |
sha256sum ${{ matrix.artifact_name }} > ${{ matrix.artifact_name }}.sha256 | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.artifact_name }} | |
path: | | |
${{ matrix.artifact_name }} | |
${{ matrix.artifact_name }}.sha256 | |
create-release: | |
needs: build-release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
**/rustygate-* | |
generate_release_notes: true |