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: Rust static build and publish | |
on: ["push"] | |
# push: | |
# tags: | |
# - '*' | |
env: | |
CARGO_TERM_COLOR: always | |
BUILD_TARGET: x86_64-unknown-linux-musl | |
BINARY_NAME: rexec | |
jobs: | |
build: | |
name: Build static binary | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: mbrobbel/rustfmt-check@master | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build-musl | |
uses: gmiam/rust-musl-action@master | |
with: | |
args: cargo build --target $BUILD_TARGET --release | |
- uses: actions/upload-artifact@v2 | |
name: Upload artifact | |
with: | |
name: ${{ env.BINARY_NAME }}_x86_64-linux-musl | |
path: target/x86_64-unknown-linux-musl/release/${{ env.BINARY_NAME }} | |
build_arch: | |
name: Arch Linux package | |
runs-on: ubuntu-latest | |
needs: ["build"] | |
container: | |
image: archlinux:base-devel | |
options: --user 1001 | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@master | |
id: download_binary | |
with: | |
name: ${{ env.BINARY_NAME }}_x86_64-linux-musl | |
path: ${{ env.BINARY_NAME }}_x86_64-linux-musl | |
- name: Install build deps | |
run: | | |
#pacman -Syu --noconfirm rustup musl git tree | |
ls -lah | |
makepkg -f | |
ls -lah | |
# release: | |
# name: Release binary | |
# needs: ["build"] | |
# runs-on: ubuntu-latest | |
# permissions: | |
# contents: write | |
# steps: | |
# - uses: actions/download-artifact@master | |
# id: download_binary | |
# with: | |
# name: ${{ env.BINARY_NAME }}_x86_64-linux-musl | |
# path: ${{ env.BINARY_NAME }}_x86_64-linux-musl | |
# - uses: actions/download-artifact@master | |
# id: download_pkgbuild | |
# with: | |
# name: PKGBUILD | |
# path: PKGBUILD | |
# - uses: ncipollo/release-action@v1 | |
# name: Update release page | |
# with: | |
# artifacts: "${{ steps.download_binary.outputs.download-path }}/*" | |
# allowUpdates: true | |
# body: Static build for x86_64-linux using MUSL |