worlds-history-sim-rs/.github/workflows/release.yaml

155 lines
5.2 KiB
YAML
Raw Normal View History

name: Release
on:
push:
tags:
- "v*"
jobs:
2022-09-19 15:05:39 +02:00
compile:
name: Build release binaries
strategy:
matrix:
include:
- target: x86_64-apple-darwin
os: macos-latest
features: render
- target: aarch64-apple-darwin
os: macos-latest
features: render
- target: x86_64-pc-windows-msvc
os: windows-latest
features: render
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
features: render
- target: x86_64-apple-darwin
os: macos-latest
features: ""
- target: aarch64-apple-darwin
os: macos-latest
features: ""
- target: x86_64-pc-windows-msvc
os: windows-latest
features: ""
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
features: ""
- target: x86_64-apple-darwin
os: macos-latest
features: render,logging
- target: aarch64-apple-darwin
os: macos-latest
features: render,logging
- target: x86_64-pc-windows-msvc
os: windows-latest
features: render,logging
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
features: render,logging
- target: x86_64-apple-darwin
os: macos-latest
features: logging
- target: aarch64-apple-darwin
os: macos-latest
features: logging
- target: x86_64-pc-windows-msvc
os: windows-latest
features: logging
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
features: logging
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
target: ${{ matrix.target }}
2022-09-21 13:56:10 +02:00
- name: Install linux dependencies
if: matrix.os == 'ubuntu-latest'
2022-09-21 13:56:10 +02:00
run: |
sudo apt-get install -y libwayland-client0 libwayland-dev libxkbcommon-dev
- run: cargo build --release --locked --target ${{ matrix.target }} --no-default-features --features=${{ matrix.features }}
- name: Post-Build | Compress [Features; -nix]
if: matrix.features != '' && !contains(matrix.os, 'windows')
2022-10-23 22:25:08 +02:00
uses: a7ul/tar-action@v1.1.2
with:
command: c
cwd: ./target/${{ matrix.target }}/release/
files: worlds-history-sim-rs
outPath: worlds-history-sim-rs-${{ matrix.target }}-${{ matrix.features }}.tar.gz
- name: Post-Build | Compress [Minimal; -nix]
if: matrix.features == '' && !contains(matrix.os, 'windows')
2022-10-23 22:25:08 +02:00
uses: a7ul/tar-action@v1.1.2
2022-09-20 15:41:56 +02:00
with:
command: c
cwd: ./target/${{ matrix.target }}/release/
files: worlds-history-sim-rs
outPath: worlds-history-sim-rs-${{ matrix.target }}-minimal.tar.gz
2022-09-19 15:05:39 +02:00
- name: Post-Build | Compress [Features; Windows]
if: matrix.features != '' && contains(matrix.os, 'windows')
2022-10-23 22:25:08 +02:00
uses: a7ul/tar-action@v1.1.2
2022-09-21 09:50:34 +02:00
with:
command: c
cwd: ./target/${{ matrix.target }}/release/
files: worlds-history-sim-rs.exe
outPath: worlds-history-sim-rs-${{ matrix.target }}-${{ matrix.features }}.tar.gz
- name: Post-Build | Compress [Minimal; Windows]
if: matrix.features == '' && contains(matrix.os, 'windows')
2022-10-23 22:25:08 +02:00
uses: a7ul/tar-action@v1.1.2
2022-09-21 09:50:34 +02:00
with:
command: c
cwd: ./target/${{ matrix.target }}/release/
files: worlds-history-sim-rs.exe
outPath: worlds-history-sim-rs-${{ matrix.target }}-minimal.tar.gz
- name: Deploy | Upload Artifacts [Features]
if: matrix.features != ''
2022-09-21 09:50:34 +02:00
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: worlds-history-sim-rs-${{ matrix.target }}-${{ matrix.features }}
path: worlds-history-sim-rs-${{ matrix.target }}-${{ matrix.features }}.tar.gz
- name: Deploy | Upload Artifacts [Minimal]
if: matrix.features == ''
2022-09-21 09:50:34 +02:00
uses: actions/upload-artifact@v3
2022-09-19 15:05:39 +02:00
with:
if-no-files-found: error
name: worlds-history-sim-rs-${{ matrix.target }}-minimal
path: worlds-history-sim-rs-${{ matrix.target }}-minimal.tar.gz
2022-09-19 15:05:39 +02:00
github-release:
name: GitHub release
runs-on: ubuntu-latest
2022-09-21 14:21:01 +02:00
needs: [compile]
2022-09-20 15:41:56 +02:00
steps:
- name: Setup | Checkout
uses: actions/checkout@v3
2022-09-19 15:05:39 +02:00
- name: Setup | Artifacts
uses: actions/download-artifact@v3
2022-09-21 09:50:34 +02:00
- name: Setup | Checksums
run: for file in worlds-history-sim-rs-**/*; do openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"; done
2022-09-20 16:02:59 +02:00
- run: ls **/*
- name: Publish
2022-09-21 09:50:34 +02:00
uses: marvinpinto/action-automatic-releases@v1.2.1
with:
2022-09-21 09:50:34 +02:00
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: ${{ contains(github.ref_name, 'pre') }}
2022-09-21 09:50:34 +02:00
files: |
**/*.sha256
**/*.tar.gz
LICENSE