mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-03-04 17:23:33 +01:00
ci: add Rust build
This commit is contained in:
parent
a153889ce6
commit
63b9f085e1
1 changed files with 54 additions and 0 deletions
54
.github/workflows/MinedMap.yml
vendored
54
.github/workflows/MinedMap.yml
vendored
|
@ -84,3 +84,57 @@ jobs:
|
|||
- run: cargo test --workspace --no-default-features
|
||||
- run: cargo test --workspace --examples --bins
|
||||
- run: cargo test --workspace --no-default-features --examples --bins
|
||||
|
||||
build:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: 'macos-11'
|
||||
target: 'aarch64-apple-darwin'
|
||||
- os: 'macos-11'
|
||||
target: 'x86_64-apple-darwin'
|
||||
- os: 'windows-2019'
|
||||
target: 'x86_64-pc-windows-msvc'
|
||||
ext: '.exe'
|
||||
- os: 'windows-2019'
|
||||
target: 'i686-pc-windows-msvc'
|
||||
ext: '.exe'
|
||||
- os: 'ubuntu-20.04'
|
||||
target: 'x86_64-unknown-linux-gnu'
|
||||
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- name: 'Checkout'
|
||||
uses: 'actions/checkout@v4'
|
||||
|
||||
- name: 'Get version'
|
||||
id: 'tag'
|
||||
shell: 'bash'
|
||||
run: |
|
||||
set -o pipefail
|
||||
git fetch --prune --unshallow --tags -f
|
||||
echo "tag=$(git describe --abbrev=7 --match='v*' | sed 's/^v//')" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: stable
|
||||
targets: '${{ matrix.target }}'
|
||||
|
||||
- uses: swatinem/rust-cache@v2
|
||||
|
||||
- name: 'Build'
|
||||
shell: 'bash'
|
||||
run: |
|
||||
pkgdir='target/pkg/MinedMap-${{ steps.tag.outputs.tag }}-${{ matrix.target }}'
|
||||
mkdir -p "$pkgdir"
|
||||
cargo build --release --target=${{ matrix.target }}
|
||||
cp target/${{ matrix.target }}/release/minedmap${{ matrix.ext }} "$pkgdir"/
|
||||
|
||||
- name: 'Archive'
|
||||
uses: 'actions/upload-artifact@v3'
|
||||
with:
|
||||
name: 'MinedMap-${{ steps.tag.outputs.tag }}-${{ matrix.target }}'
|
||||
path: 'target/pkg'
|
||||
|
|
Loading…
Add table
Reference in a new issue