-
Notifications
You must be signed in to change notification settings - Fork 8
49 lines (49 loc) · 1.54 KB
/
windows.yml
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
---
name: windows
"on":
- workflow_dispatch
env:
RUSTFLAGS: "-D warnings"
GITHUB_TOKEN: "${{ secrets.FULL_GITHUB_TOKEN }}"
GITHUB_USER: "${{ github.actor }}"
jobs:
build:
strategy:
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
root: "."
rustflags: "-D warnings"
bin_name: versio.exe
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: "${{ matrix.os }}"
steps:
- name: Checkout release
uses: actions/checkout@v3
with:
ref: main
- name: Get Windows cargo stable
if: "matrix.os == 'windows-latest'"
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Get Windows cargo nightly
if: "matrix.os == 'windows-latest'"
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Find paths
id: cargo-find-paths
run: "echo ::set-output name=cargo-lock-glob::\"${{ matrix.root }}\"/**/Cargo.lock"
- name: Cache cargo and target
uses: actions/cache@v1
with:
path: "~/.cargo/registry\n~/.cargo/git\n${{ matrix.root }}/target\n"
key: "${{ runner.os }}-cargo-${{ hashFiles(steps.cargo-find-paths.outputs.cargo-lock-glob) }}"
- name: Build Windows binary
if: "matrix.os == 'windows-latest'"
run: cargo build --release
working-directory: "${{ matrix.root }}"
env:
RUSTFLAGS: "${{ matrix.rustflags }}"