-
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.33 KB
/
build.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
name: Build
on:
workflow_dispatch:
push:
branches: ["main"]
pull_request:
branches: ["main"]
release:
types: [created]
env:
CARGO_TERM_COLOR: always
jobs:
build:
permissions: write-all
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
key: ${{ github.event_name == 'release' && 'prod' || 'dev' }}
- name: Build
env:
RELEASE: ${{ github.event_name == 'release' && '--release' || '' }}
run: cargo build $env:RELEASE
- name: Upload Artifacts
if: github.event_name != 'release'
uses: actions/upload-artifact@v3
with:
name: build
path: |
target/*/*.exe
- name: Zip files up
if: github.event_name == 'release'
run: |
Get-ChildItem -Path target/*/*.exe,assets/* | Compress-Archive -CompressionLevel Optimal -DestinationPath "yet-another-bg3-mod-loader-x64.zip"
- name: Attach assets to release
if: github.event_name == 'release'
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "*.zip"
draft: false
release_id: ${{ github.event.release.id }}