Skip to content

windows

windows #7

Workflow file for this run

---
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: Install winget
if: "matrix.os == 'windows-latest'"
uses: Cyberboss/install-winget@v1
- name: Install Windows dependencies
if: "matrix.os == 'windows-latest'"
run: |
winget install --id GnuPG.Gpg4win --silent --disable-interactivity --accept-source-agreements --accept-package-agreements --no-upgrade --force
- name: Get Windows cargo stable
if: "matrix.os == 'windows-latest'"
uses: actions-rs/toolchain@v1
with:
toolchain: stable-i686-pc-windows-gnu
target: i686-pc-windows-gnu
components: clippy
default: true
- name: Get Windows cargo nightly
if: "matrix.os == 'windows-latest'"
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-i686-pc-windows-gnu
target: i686-pc-windows-gnu
components: rustfmt
- name: Update Windows target configuration
if: "matrix.os == 'windows-latest'"
run: rustup set default-host i686-pc-windows-gnu
- 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 --target i686-pc-windows-gnu
working-directory: "${{ matrix.root }}"
env:
RUSTFLAGS: "${{ matrix.rustflags }}"