Skip to content

feat: builds, packages, pushing contains to ghcr #14

feat: builds, packages, pushing contains to ghcr

feat: builds, packages, pushing contains to ghcr #14

Workflow file for this run

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:
include:
- target: aarch64-unknown-linux-gnu
- target: aarch64-unknown-linux-musl
- target: aarch64-apple-darwin
os: macos-latest
- target: x86_64-unknown-linux-gnu
- target: x86_64-unknown-linux-musl
- target: x86_64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
- target: x86_64-unknown-freebsd
timeout-minutes: 60
runs-on: ${{ matrix.os || 'ubuntu-20.04' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install OpenSSL
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt update && sudo apt install -y libssl-dev
- name: Install musl-tools
run: sudo apt update && sudo apt install -y musl-dev musl-tools
if: matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl'
- 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: cross-build
uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.target }}
- name: crt-static
run: echo "RUSTFLAGS=${RUSTFLAGS} -C target-feature=+crt-static" >>"${GITHUB_ENV}"
if: endsWith(matrix.target, 'windows-msvc')
- name: Build Binary
run: cargo build -p homestar-runtime --target ${{ matrix.target }} --locked --release
- name: Publish Release Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target }}
path: target/${{ matrix.target }}/release/homestar*
if-no-files-found: error
- uses: taiki-e/upload-rust-binary-action@v1
with:
bin: homestar
target: ${{ matrix.target }}
tar: all
zip: windows
include: LICENSE,README.md
token: ${{ secrets.GITHUB_TOKEN }}