1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
on:
push:
branches:
- test-windows
name: Test Windows
jobs:
build:
strategy:
matrix:
include:
- 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 stable toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Get version
id: version
shell: bash
run: |
version=v$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')
pkgdir="ck3-tiger-${{ matrix.name }}-$version"
echo "::set-output name=version::$version"
echo "::set-output name=pkgdir::$pkgdir"
- name: Build
run: cargo build --release -p ck3-tiger
- name: Create output dir
shell: bash
run: |
mkdir ${{ steps.version.outputs.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.pkgdir }}
- name: Archive .zip
uses: vimtor/action-zip@v1
if: ${{ matrix.archive == 'zip' }}
with:
files: ${{ steps.version.outputs.pkgdir }}/
dest: ${{ steps.version.outputs.pkgdir }}.zip
- name: Archive .tar.gz
if: ${{ matrix.archive == 'tar.gz' }}
run: tar cfvz ${{ steps.version.outputs.pkgdir }}.tar.gz ${{ steps.version.outputs.pkgdir }}/
- name: Upload Archive
uses: actions/upload-artifact@v4
with:
name: archives
path: ${{ steps.version.outputs.pkgdir }}.${{ matrix.archive }}
if-no-files-found: error