Add workflow for building and releasing binaries #15
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: Build artifacts for release | |
on: | |
pull_request: | |
branches: [main] | |
jobs: | |
build_linux-x86_64: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Compile | |
id: compile | |
uses: rust-build/[email protected] | |
with: | |
ARCHIVE_TYPES: tar.gz | |
ARCHIVE_NAME: sablast-candidate-x86_64-unknown-linux-musl | |
RUSTTARGET: x86_64-unknown-linux-musl | |
EXTRA_FILES: "COPYRIGHT LICENSE-APACHE LICENSE-MIT README.md" | |
TOOLCHAIN_VERSION: stable-2024-09-05 | |
UPLOAD_MODE: none | |
- name: Upload x86_64-unknown-linux-musl | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sablast-candidate-x86_64-unknown-linux-musl | |
path: | | |
${{ steps.compile.outputs.BUILT_ARCHIVE }} | |
${{ steps.compile.outputs.BUILT_CHECKSUM }} | |
build_macOS-x86_64: | |
runs-on: ubuntu-latest | |
container: ghcr.io/shepherdjerred/macos-cross-compiler:latest | |
steps: | |
- name: Install wget and git | |
id: install-wget | |
run: apt-get update && apt install -y wget git | |
- name: Create io directory | |
id: mkdir-io | |
run: mkdir /io && cd /io | |
- name: Download build script | |
id: dl-build-script | |
run: wget https://raw.githubusercontent.com/${{ github.repository }}/${{ github.head_ref }}/.github/deploy/build_x86_64-apple-darwin.sh | |
- name: Compile in macOS Cross Compiler container | |
id: compile-in-container | |
run: chmod +x build_x86_64-apple-darwin.sh && ./build_x86_64-apple-darwin.sh ${{ github.head_ref }} arm64 | |
- name: Upload x86_64-apple-darwin | |
if: success() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sablast-candidate-x86_64-apple-darwin | |
path: /io/sablast-candidate-x86_64-apple-darwin.tar.gz | |
- name: Upload x86_64-apple-darwin sha256sum | |
if: success() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sablast-candidate-x86_64-apple-darwin-sha256sum | |
path: /io/sablast-candidate-x86_64-apple-darwin.tar.gz.sha256sum | |
build_macOS-aarch64: | |
runs-on: ubuntu-latest | |
container: ghcr.io/shepherdjerred/macos-cross-compiler:latest | |
steps: | |
- name: Install wget and git | |
id: install-wget | |
run: apt-get update && apt install -y wget git | |
- name: Create io directory | |
id: mkdir-io | |
run: mkdir /io && cd /io | |
- name: Download build script | |
id: dl-build-script | |
run: wget https://raw.githubusercontent.com/${{ github.repository }}/${{ github.head_ref }}/.github/deploy/build_aarch64-apple-darwin.sh | |
- name: Compile in macOS Cross Compiler container | |
id: compile-in-container | |
run: chmod +x build_aarch64-apple-darwin.sh && ./build_aarch64-apple-darwin.sh ${{ github.head_ref }} | |
- name: Upload aarch64-apple-darwin | |
if: success() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sablast-candidate-aarch64-apple-darwin | |
path: /io/sablast-candidate-aarch64-apple-darwin.tar.gz | |
- name: Upload aarch64-apple-darwin sha256sum | |
if: success() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sablast-candidate-aarch64-apple-darwin-sha256sum | |
path: /io/sablast-candidate-aarch64-apple-darwin.tar.gz.sha256sum |