Create Release #9
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: Create Release | |
on: | |
workflow_dispatch: | |
inputs: | |
nextVersion: | |
description: "new version to push" | |
required: true | |
default: "0.0.0" | |
jobs: | |
build-windows: | |
runs-on: windows-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: moonrepo/setup-rust@v1 | |
- name: Install toml-cli | |
run: cargo install toml-cli | |
- name: Update Cargo.toml with new version | |
# piping the output of toml-cli directly into the file will cause the file to be deleted before being read | |
# by toml-cli. excuse this workaround. | |
run: | | |
toml set Cargo.toml package.version ${{inputs.nextVersion}} > Cargo.toml.tmp | |
rm Cargo.toml | |
mv Cargo.toml.tmp Cargo.toml | |
cargo generate-lockfile | |
- name: Download npcap sdk | |
run: curl --silent --show-error --fail -o ./npcap-sdk.zip "https://npcap.com/dist/npcap-sdk-1.13.zip" | |
- name: Extract npcap x64 libs | |
run: | | |
unzip -p npcap-sdk.zip Lib/x64/Packet.lib > Packet.lib | |
unzip -p npcap-sdk.zip Lib/x64/wpcap.lib > wpcap.lib | |
- name: Build Windows exe | |
run: cargo build --release | |
- name: Push updated version | |
run: | | |
git config user.name "reliquary-archiver bot" | |
git config user.email "[email protected]" | |
git add Cargo.toml | |
git add Cargo.lock | |
git commit -m "[skip ci] bump version to v${{inputs.nextVersion}}" | |
git push origin main | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: reliquary-archiver_x64 | |
path: target/release/reliquary-archiver.exe | |
create-release: | |
runs-on: ubuntu-latest | |
needs: [build-windows] | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: moonrepo/setup-rust@v1 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: reliquary-archiver_x64 | |
path: x64 | |
- name: Append version to exe | |
run: mv x64/reliquary-archiver.exe ./reliquary-archiver_x64_v${{inputs.nextVersion}}.exe | |
- name: Create and push version tag | |
run: | | |
git tag v${{inputs.nextVersion}} | |
git push origin --tags | |
- name: Create release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: v${{inputs.nextVersion}} | |
name: "v${{inputs.nextVersion}}" | |
artifacts: "reliquary-archiver*.exe" |