-
Notifications
You must be signed in to change notification settings - Fork 6
86 lines (73 loc) · 2.72 KB
/
release_cli.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
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