Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build, Package, and Release (Rust)

on:
push:
branches:
- add-Windows-build-action
pull_request:

jobs:
build-and-release:
runs-on: windows-latest

steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Install Rust toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
$env:Path += ";$HOME\.cargo\bin"
rustup install stable
rustup default stable

- name: Build the project
run: cargo build --release

- name: Package build artifacts
run: |
mkdir release
Copy-Item target\release\* release\
Compress-Archive -Path release\* -DestinationPath release\artifacts.zip

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: windows-build-${{ github.run_id }}
release_name: "Windows Build #${{ github.run_number }}"
draft: false
prerelease: true

- name: Upload Release Artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: release/artifacts.zip
asset_name: artifacts.zip
asset_content_type: application/zip
Loading