Update rust.yml #7
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: Automated Rust Release | |
on: | |
push: | |
branches: | |
- main # Trigger on changes to the main branch | |
workflow_dispatch: # Allow manual triggering of the workflow | |
jobs: | |
release: | |
name: Cargo Release | |
runs-on: windows-latest # Use Windows for DLL builds | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Set Up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Install Cargo Release | |
run: cargo install cargo-release | |
- name: Run Cargo Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Required for tagging and pushing | |
run: cargo release --execute | |
- name: Build DLL | |
run: cargo build --release | |
- name: Create GitHub Release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: target/release/*.dll | |
tag: ${{ github.ref_name }} # Uses the tag created by `cargo release` | |
name: Release ${{ github.ref_name }} | |
body: | | |
This release was automatically created using cargo-release and GitHub Actions. | |
token: ${{ secrets.GITHUB_TOKEN }} |