Repository navigation
79 lines (69 loc) · 2.58 KB
/
Copy pathci.yml
File metadata and controls
79 lines (69 loc) · 2.58 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
# A newer push to the same branch makes the running check moot.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
release-bundle:
runs-on: windows-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
# rustup is on GitHub's runners; rust-toolchain.toml names the toolchain
# and its components, as it does on a developer's machine.
- name: Rust toolchain
id: rust
shell: pwsh
run: |
rustup toolchain install
"version=$((rustc -V) -replace '[^\w.]+', '-')" >> $env:GITHUB_OUTPUT
# Keyed on the compiler too: a new stable cannot reuse what an older one
# compiled.
- uses: actions/cache@v6
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: cargo-${{ runner.os }}-${{ steps.rust.outputs.version }}-${{ hashFiles('Cargo.lock') }}
restore-keys: cargo-${{ runner.os }}-${{ steps.rust.outputs.version }}-
# The same checklist a developer runs: fmt, clippy -D warnings, tests,
# every shipped config.toml validated, every documentation link
# resolved, release build, PE subsystem check, commit stamp check, the
# zip and the installer with the SDK's ICEs run over it. A release
# nobody can make by hand is not one CI can make either, so there is
# one script and CI calls it.
- name: Test, build and package
shell: pwsh
run: .\scripts\build.ps1 release
- name: Read the version
id: version
shell: pwsh
run: |
$version = (Select-String -Path Cargo.toml -Pattern '^version = "(.+)"').Matches[0].Groups[1].Value
"version=$version" >> $env:GITHUB_OUTPUT
# The three artefacts, in one download. GitHub serves every artifact as
# a zip of its own whatever it holds -- there is no raw download from
# the Actions page -- so the level is 0 to keep it a plain container
# around files that are already compressed. Raw files come from
# the release workflow, which attaches them to the release itself.
- uses: actions/upload-artifact@v7
with:
name: GameModeExecutor-${{ steps.version.outputs.version }}
path: |
dist/*.msi
dist/*.zip
compression-level: 0
if-no-files-found: error