2024-03-05 14:02:06 +13:00
|
|
|
name: Release Build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths-ignore:
|
|
|
|
- "*.md"
|
|
|
|
- "compose.*"
|
|
|
|
branches:
|
|
|
|
- "main"
|
2024-05-31 20:19:44 +12:00
|
|
|
release:
|
|
|
|
types: [published]
|
2024-03-05 14:02:06 +13:00
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER: aarch64-linux-gnu-gcc
|
|
|
|
CC_aarch64_unknown_linux_musl: aarch64-linux-gnu-gcc
|
|
|
|
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_MUSLEABIHF_LINKER: arm-linux-gnueabihf-gcc
|
|
|
|
CC_armv7_unknown_linux_musleabihf: arm-linux-gnueabihf-gcc
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Rust project - latest
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
target:
|
|
|
|
- x86_64-unknown-linux-musl
|
|
|
|
- aarch64-unknown-linux-musl
|
|
|
|
- armv7-unknown-linux-musleabihf
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
|
|
with:
|
|
|
|
target: ${{ matrix.target }}
|
|
|
|
|
|
|
|
- if: matrix.target == 'x86_64-unknown-linux-musl'
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2024-11-20 05:12:04 +13:00
|
|
|
sudo apt-get install -y --no-install-recommends musl-tools libssl-dev
|
2024-03-05 14:02:06 +13:00
|
|
|
|
|
|
|
- if: matrix.target == 'armv7-unknown-linux-musleabihf'
|
|
|
|
run: |
|
|
|
|
sudo apt update
|
2024-11-20 05:12:04 +13:00
|
|
|
sudo apt install -y gcc-arm-linux-gnueabihf musl-tools libssl-dev
|
2024-03-05 14:02:06 +13:00
|
|
|
|
|
|
|
- if: matrix.target == 'aarch64-unknown-linux-musl'
|
|
|
|
run: |
|
|
|
|
sudo apt update
|
2024-11-20 05:12:04 +13:00
|
|
|
sudo apt install -y gcc-aarch64-linux-gnu musl-tools libssl-dev
|
2024-03-05 14:02:06 +13:00
|
|
|
|
|
|
|
- name: Versions
|
|
|
|
id: version
|
|
|
|
run: echo "VERSION=$(cargo metadata --format-version 1 --no-deps | jq .packages[0].version -r | sed 's/^/v/')" >> "$GITHUB_OUTPUT"
|
|
|
|
|
|
|
|
- name: Build
|
2024-11-20 06:53:36 +13:00
|
|
|
run: RUSTFLAGS='-C target-feature=+crt-static' cargo build --release --target ${{ matrix.target }}
|
2024-03-05 14:02:06 +13:00
|
|
|
|
|
|
|
- name: Package release
|
|
|
|
run: tar czf redlib-${{ matrix.target }}.tar.gz -C target/${{ matrix.target }}/release/ redlib
|
|
|
|
|
|
|
|
- name: Upload release
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
tag_name: ${{ steps.version.outputs.VERSION }}
|
|
|
|
name: ${{ steps.version.outputs.VERSION }} - ${{ github.event.head_commit.message }}
|
|
|
|
draft: true
|
|
|
|
files: |
|
|
|
|
redlib-${{ matrix.target }}.tar.gz
|
|
|
|
body: |
|
|
|
|
- ${{ github.event.head_commit.message }} ${{ github.sha }}
|
|
|
|
generate_release_notes: true
|
|
|
|
|
|
|
|
|
|
|
|
|