feat: builds, packages, pushing contains to ghcr #7
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: ⚃ Builds | |
on: | |
workflow_dispatch: | |
inputs: | |
force-builds: | |
required: true | |
type: boolean | |
description: Publish Builds at Anytime | |
pull_request: | |
branches: [ '**' ] | |
# workflow_run: | |
# workflows: [ 𝌚 Release ] | |
# branches: [main] | |
# types: [ completed ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
builds: | |
strategy: | |
matrix: | |
platform: | |
- release_for: FreeBSD-x86_64 | |
os: ubuntu-latest | |
target: x86_64-unknown-freebsd | |
bin: homestar | |
name: homestar-FreeBSD-x86_64.tar.gz | |
command: build | |
- os_name: Linux-x86_64 | |
os: ubuntu-latest | |
target: x86_64-unknown-linux-musl | |
bin: homestar | |
name: homestar-Linux-x86_64-musl.tar.gz | |
- os_name: Linux-aarch64 | |
os: ubuntu-latest | |
target: aarch64-unknown-linux-musl | |
bin: homestar | |
name: homestar-Linux-aarch64-musl.tar.gz | |
- release_for: Windows-x86_64 | |
os: windows-latest | |
target: x86_64-pc-windows-msvc | |
bin: homestar.exe | |
name: homestar-Windows-x86_64.zip | |
command: both | |
- release_for: macOS-x86_64 | |
os: macOS-latest | |
target: x86_64-apple-darwin | |
bin: homestar | |
name: homestar-Darwin-x86_64.tar.gz | |
command: both | |
- release_for: macOS-Arm | |
os: macOS-latest | |
target: aarch64-apple-darwin | |
bin: homestar | |
name: homestar-Darwin-aarch64.tar.gz | |
command: both | |
runs-on: ${{ matrix.platform.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache Project | |
uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
shared-key: check-${{ matrix.platform.target }}-${{ matrix.platform.os }} | |
save-if: ${{ github.event_name == 'push' }} | |
- name: Use mold-linker | |
if: ${{ matrix.platform.os == 'ubuntu-latest' }} | |
uses: rui314/setup-mold@v1 | |
- name: Install Rust Toolchain | |
id: toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Override rust-toolchain.toml | |
run: rustup override set ${{steps.toolchain.outputs.name}} | |
- name: Install musl-tools | |
if: ${{ matrix.platform.os == 'ubuntu-latest' }} | |
run: sudo apt install musl-tools | |
- name: Set exe extension for Windows | |
run: echo "EXE=.exe" >> $env:GITHUB_ENV | |
if: startsWith(matrix.os, 'windows') | |
- name: Build Binary | |
uses: houseabsolute/actions-rust-cross@v0 | |
with: | |
command: ${{ matrix.platform.command }} | |
target: ${{ matrix.platform.target }} | |
args: "-p homestar-runtime --locked --release" | |
strip: true | |
- name: Publish Release Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: hometar-${{ matrix.platform.os_name }} | |
path: "homestar-*" | |
if-no-files-found: error |