Create CLI Release #32
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 CLI Release | |
on: | |
workflow_dispatch: | |
jobs: | |
release: | |
permissions: | |
contents: write | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [ubuntu-20.04, windows-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Rust Toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
- name: Setup Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: ${{ runner.os }}-rust-cache-${{ hashFiles('Cargo.lock') }} | |
- name: Install Deb Generator | |
if: matrix.platform == 'ubuntu-20.04' | |
run: cargo install cargo-deb | |
- name: Build CLI | |
run: cargo build -p owmods_cli --release | |
env: | |
ANALYTICS_API_KEY: ${{ secrets.ANALYTICS_API_KEY }} | |
- name: Get Version | |
id: get_version | |
run: echo "version=$(cargo run --release -q -p owmods_cli version)" >> $GITHUB_OUTPUT | |
shell: bash | |
env: | |
ANALYTICS_API_KEY: ${{ secrets.ANALYTICS_API_KEY }} | |
- name: Generate Dist Folder | |
if: matrix.platform == 'ubuntu-20.04' | |
run: cargo xtask dist_cli | |
env: | |
ANALYTICS_API_KEY: ${{ secrets.ANALYTICS_API_KEY }} | |
- name: Archive Dist Files | |
if: matrix.platform == 'ubuntu-20.04' | |
run: tar --zstd -cfowmods.tar.zst -C target/release owmods -C ../../dist/cli/ man completions | |
- name: Generate Deb File | |
if: matrix.platform == 'ubuntu-20.04' | |
run: cargo deb -p owmods_cli -o owmods_cli_${{ steps.get_version.outputs.version }}_amd64.deb | |
env: | |
ANALYTICS_API_KEY: ${{ secrets.ANALYTICS_API_KEY }} | |
- name: Upload CLI (Ubuntu) | |
if: matrix.platform == 'ubuntu-20.04' | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: Outer Wilds Mod Manager CLI Version ${{ steps.get_version.outputs.version }} | |
tag_name: cli_v${{ steps.get_version.outputs.version }} | |
fail_on_unmatched_files: false | |
generate_release_notes: false | |
draft: true | |
files: | | |
owmods.tar.zst | |
owmods_cli_${{ steps.get_version.outputs.version }}_amd64.deb | |
target/release/owmods | |
- name: Upload CLI (Windows) | |
if: matrix.platform == 'windows-latest' | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: Outer Wilds Mod Manager CLI Version ${{ steps.get_version.outputs.version }} | |
tag_name: cli_v${{ steps.get_version.outputs.version }} | |
fail_on_unmatched_files: false | |
generate_release_notes: false | |
draft: true | |
files: | | |
target/release/owmods.exe |