Skip to content

Auto merge! (merge-pr-in-all) #11

Auto merge! (merge-pr-in-all)

Auto merge! (merge-pr-in-all) #11

Workflow file for this run

on:
push:
branches:
- "master"
tags:
- "v*"
env:
CARGO_INCREMENTAL: 0
jobs:
release:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
file: base65536
output: base65536-linux.zip
- target: x86_64-pc-windows-gnu
file: base65536.exe
output: base65536-windows.zip
name: release
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4.2.2
- if: ${{ matrix.target == 'x86_64-pc-windows-gnu' }}
run: |
sudo apt-get install -y gcc-mingw-w64-x86-64
- name: Get Rust toolchain
id: toolchain
run: |
awk -F'[ ="]+' '$1 == "channel" { print "toolchain=" $2 }' rust-toolchain >> "$GITHUB_OUTPUT"
- name: install clippy
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
toolchain: ${{ steps.toolchain.outputs.toolchain }}
targets: x86_64-pc-windows-gnu
- uses: actions-rs/toolchain@v1.0.7
with:
toolchain: stable
target: x86_64-pc-windows-gnu
- name: cache dependencies
uses: Swatinem/rust-cache@v2.7.8
- name: clippy check
uses: sksat/action-clippy@v1.1.1
with:
reporter: github-check
- name: install cargo-license
run: cargo install cargo-license
- name: unit test
run: |
cargo test --no-run --locked
cargo test
- name: build
env:
TARGET: ${{ matrix.target }}
run:
cargo build --release --target $TARGET
- env:
TARGET: ${{ matrix.target }}
FILE: ${{ matrix.file }}
OUTPUT: ${{ matrix.output }}
run: |
mkdir base65536
cargo license \
--authors \
--do-not-bundle \
--avoid-dev-deps \
--avoid-build-deps \
--filter-platform $TARGET \
> base65536/CREDITS
VERSION_NAME=${GITHUB_REF##*/}
if [[ $VERSION_NAME == "master" ]]; then
VERSION_NAME=$(git rev-parse --short HEAD)
elif [[ ${VERSION_NAME:0:1} == "v" ]]; then
VERSION_NAME=${VERSION_NAME:1}
fi
echo "$VERSION_NAME" > base65536/VERSION.txt
cp LICENSE README.md base65536/
cp target/$TARGET/release/$FILE base65536/
zip -r $OUTPUT base65536
- name: pre-release
uses: softprops/action-gh-release@v2.2.2
if: "! startsWith(github.ref, 'refs/tags/')"
with:
tag_name: nightly-${{ github.sha }}
prerelease: true
fail_on_unmatched_files: true
files: |
${{ matrix.output }}
- name: tagged-release
uses: softprops/action-gh-release@v2.2.2
if: startsWith(github.ref, 'refs/tags/')
with:
fail_on_unmatched_files: true
files: |
${{ matrix.output }}