Skip to content
name: Build & Publish Nightly Release
on:
push:
branches:
- '**'
env:
CARGO_TERM_COLOR: always
NIGHTLY_RELEASE_DIR: build/release
jobs:
build-nightly-release:
runs-on: ${{ matrix.os }}
env:
RUST_BACKTRACE: full
strategy:
fail-fast: false
matrix:
target: [x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, x86_64-apple-darwin, aarch64-apple-darwin]
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: macos-latest
steps:
- name: Install Rust
run: |
rustup set profile minimal
rustup toolchain install stable
rustup default stable
rustup override set stable
rustup target add --toolchain stable ${{ matrix.target }}
- name: Install cross
run: |
cargo install cross
- name: Checkout
uses: actions/checkout@v4
- name: Build ${{ matrix.target }}
timeout-minutes: 120
run: |
cross build --target ${{ matrix.target }} --release
- name: Prepare release
run: |
LURK_VERSION=$(grep -E '^version' Cargo.toml | awk '{print $3}' | sed 's/"//g')
LURK_RELEASE_NAME=lurk-v${LURK_VERSION}-nightly-${{ matrix.target }}
mkdir -p ${{ env.NIGHTLY_RELEASE_DIR }}
mv target/${{ matrix.target }}/release/lurk ${{env.NIGHTLY_RELEASE_DIR}}/${LURK_RELEASE_NAME}
echo "ref: $GITHUB_REF" > ${{ env.NIGHTLY_RELEASE_DIR }}/README.md
echo "commit: $GITHUB_SHA" >> ${{ env.NIGHTLY_RELEASE_DIR }}/README.md
echo "date: $(date +"%Y-%m-%dT%H:%M:%SZ")" >> ${{ env.NIGHTLY_RELEASE_DIR }}/README.md
- name: Upload Nightly Release Assets
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ${{ env.NIGHTLY_RELEASE_DIR }}/*
prerelease: true
tag_name: nightly