CI/CD #4
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
name: Windows Build | |
on: | |
push: | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build_and_test: | |
name: logstatter - latest | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
toolchain: | |
- stable | |
windows_version: | |
- 10 | |
- 11 | |
arch: | |
- x86_64 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Vcpkg | |
run: | | |
git clone https://github.com/Microsoft/vcpkg | |
cd vcpkg | |
.\bootstrap-vcpkg.bat | |
.\vcpkg.exe install openssl-windows:x64-windows | |
.\vcpkg.exe install openssl:x64-windows-static | |
.\vcpkg.exe integrate install | |
cd .. | |
- name: Set up Rust | |
run: choco install rust -y | |
- name: Build and test | |
run: cargo build --verbose | |
- name: Create Windows Release | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: target/release/logstatter.exe | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TAG: latest/windows |