feat: builds, packages, pushing contains to ghcr #9
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 | |
permissions: | |
contents: write | |
jobs: | |
builds: | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
- release_for: FreeBSD-x86_64 | |
os: ubuntu-20.04 | |
target: x86_64-unknown-freebsd | |
bin: homestar | |
name: homestar-FreeBSD-x86_64.tar.gz | |
command: build | |
- os_name: Linux-x86_64 | |
os: ubuntu-20.04 | |
target: x86_64-unknown-linux-musl | |
bin: homestar | |
name: homestar-Linux-x86_64-musl.tar.gz | |
command: both | |
- os_name: Linux-aarch64 | |
os: ubuntu-20.04 | |
target: aarch64-unknown-linux-musl | |
bin: homestar | |
name: homestar-Linux-aarch64-musl.tar.gz | |
command: both | |
- 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: 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-20.04' }} | |
run: | | |
set -ex | |
sudo apt-get update | |
sudo apt-get install -y musl-tools | |
- 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 |