-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (68 loc) · 2.07 KB
/
build.yml
File metadata and controls
80 lines (68 loc) · 2.07 KB
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
name: Rust Build and Release
on:
pull_request:
types: [ opened, synchronize, reopened ]
push:
tags:
- 'v*.*.*'
jobs:
validate_build:
name: Validate Build
runs-on: windows-latest
strategy:
matrix:
config: [ debug, release ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build ${{ matrix.config }}
shell: pwsh
run: |
if ("${{ matrix.config }}" -eq "release") {
cargo install cbindgen
cbindgen --config cbindgen.toml --crate navkit-rpkg-lib --output navkit-rpkg-lib.h
cargo build --release
New-Item -ItemType Directory -Force -Path build/x64-release
Copy-Item target/release/navkit_rpkg_lib.dll build/x64-release/
Copy-Item target/release/navkit_rpkg_lib.dll.lib build/x64-release/
Copy-Item navkit-rpkg-lib.h build/x64-release/
} else {
cargo build
}
- name: Upload Release Build Artifact
if: matrix.config == 'release'
uses: actions/upload-artifact@v4
with:
name: navkit-rpkg-lib
path: build/x64-release/
create_release:
name: Create Release with Library files
runs-on: windows-latest
if: startsWith(github.ref, 'refs/tags/v')
needs: validate_build
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download Release Build Artifact
uses: actions/download-artifact@v4
with:
name: navkit-rpkg-lib
path: build/x64-release/
- name: List Files
shell: pwsh
run: |
Get-ChildItem -Path build/x64-release/
- name: Upload library files to GitHub Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/x64-release/*
file_glob: true
tag: ${{ github.ref }}
overwrite: true