Version 1.6.0 #63
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
tags: | |
- v[0-9]+* | |
name: Release | |
jobs: | |
build: | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
name: linux | |
extension: | |
archive: tar.gz | |
- os: windows-latest | |
name: windows | |
extension: .exe | |
archive: zip | |
name: ${{ matrix.name }} build | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Install msrv toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: 1.80.0 | |
- name: Get version | |
id: version | |
shell: bash | |
run: | | |
version=v$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version') | |
ck3_pkgdir="ck3-tiger-${{ matrix.name }}-$version" | |
vic3_pkgdir="vic3-tiger-${{ matrix.name }}-$version" | |
imperator_pkgdir="imperator-tiger-${{ matrix.name }}-$version" | |
echo "::set-output name=version::$version" | |
echo "::set-output name=ck3_pkgdir::$ck3_pkgdir" | |
echo "::set-output name=vic3_pkgdir::$vic3_pkgdir" | |
echo "::set-output name=imperator_pkgdir::$imperator_pkgdir" | |
- name: Verify version against tag | |
shell: bash | |
run: | | |
test "${{ github.ref_name }}" = "${{ steps.version.outputs.version }}" | |
- name: Build CK3 | |
run: cargo build --release -p ck3-tiger | |
- name: Build Vic3 | |
run: cargo build --release -p vic3-tiger | |
- name: Build Imperator | |
run: cargo build --release -p imperator-tiger | |
- name: Create output dirs | |
shell: bash | |
run: | | |
mkdir ${{ steps.version.outputs.ck3_pkgdir }} | |
cp -p README.md filter.md TODO.md CONTRIBUTORS.md LICENSE ck3-tiger.conf target/release/ck3-tiger${{ matrix.extension }} target/release/ck3-tiger-auto${{ matrix.extension }} ${{ steps.version.outputs.ck3_pkgdir }} | |
mkdir ${{ steps.version.outputs.vic3_pkgdir }} | |
cp -p README.md filter.md TODO.md CONTRIBUTORS.md LICENSE vic3-tiger.conf target/release/vic3-tiger${{ matrix.extension }} target/release/vic3-tiger-auto${{ matrix.extension }} ${{ steps.version.outputs.vic3_pkgdir }} | |
mkdir ${{ steps.version.outputs.imperator_pkgdir }} | |
cp -p README.md filter.md TODO.md CONTRIBUTORS.md LICENSE imperator-tiger.conf target/release/imperator-tiger${{ matrix.extension }} ${{ steps.version.outputs.imperator_pkgdir }} | |
- name: Archive .zip ck3 | |
uses: vimtor/action-zip@v1 | |
if: ${{ matrix.archive == 'zip' }} | |
with: | |
files: ${{ steps.version.outputs.ck3_pkgdir }}/ | |
dest: ${{ steps.version.outputs.ck3_pkgdir }}.zip | |
- name: Archive .zip vic3 | |
uses: vimtor/action-zip@v1 | |
if: ${{ matrix.archive == 'zip' }} | |
with: | |
files: ${{ steps.version.outputs.vic3_pkgdir }}/ | |
dest: ${{ steps.version.outputs.vic3_pkgdir }}.zip | |
- name: Archive .zip imperator | |
uses: vimtor/action-zip@v1 | |
if: ${{ matrix.archive == 'zip' }} | |
with: | |
files: ${{ steps.version.outputs.imperator_pkgdir }}/ | |
dest: ${{ steps.version.outputs.imperator_pkgdir }}.zip | |
- name: Archive .tar.gz | |
if: ${{ matrix.archive == 'tar.gz' }} | |
run: | | |
tar cfvz ${{ steps.version.outputs.ck3_pkgdir }}.tar.gz ${{ steps.version.outputs.ck3_pkgdir }}/ | |
tar cfvz ${{ steps.version.outputs.vic3_pkgdir }}.tar.gz ${{ steps.version.outputs.vic3_pkgdir }}/ | |
tar cfvz ${{ steps.version.outputs.imperator_pkgdir }}.tar.gz ${{ steps.version.outputs.imperator_pkgdir }}/ | |
- name: Upload Archive ck3 | |
uses: actions/upload-artifact@v4 | |
with: | |
name: archives-ck3-${{ matrix.name }} | |
path: ${{ steps.version.outputs.ck3_pkgdir }}.${{ matrix.archive }} | |
if-no-files-found: error | |
- name: Upload Archive vic3 | |
uses: actions/upload-artifact@v4 | |
with: | |
name: archives-vic3-${{ matrix.name }} | |
path: ${{ steps.version.outputs.vic3_pkgdir }}.${{ matrix.archive }} | |
if-no-files-found: error | |
- name: Upload Archive imperator | |
uses: actions/upload-artifact@v4 | |
with: | |
name: archives-imperator-${{ matrix.name }} | |
path: ${{ steps.version.outputs.imperator_pkgdir }}.${{ matrix.archive }} | |
if-no-files-found: error | |
release: | |
needs: build | |
name: Create Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch Archives | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: archives-* | |
merge-multiple: true | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: '*.zip,*.tar.gz' |