This repository has been archived by the owner on Oct 8, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
110 lines (90 loc) · 3.12 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
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Build
on: [ push, pull_request ]
jobs:
build-cli:
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Print dotnet version
run: dotnet --info
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set Library Versions
run: dotnet run --set-version
- name: Set Rust Flags (Windows)
shell: pwsh
run: |
rustup target add i686-pc-windows-msvc
Add-Content -Path $env:GITHUB_ENV -Value "EXTRA_RUST_FLAGS=--target i686-pc-windows-msvc"
if: ${{ matrix.os == 'windows-latest' }}
- name: Set Rust Flags (Linux)
run: echo "EXTRA_RUST_FLAGS=--target x86_64-unknown-linux-gnu" >> "$GITHUB_ENV"
if: ${{ matrix.os == 'ubuntu-latest' }}
- name: Build Rust
working-directory: for-rust
run: cargo build --features cli --release ${{ env.EXTRA_RUST_FLAGS }}
- name: Collect Rust Binaries (Windows)
working-directory: for-rust/target
run: |
copy i686-pc-windows-msvc\release\*.exe release
copy i686-pc-windows-msvc\release\*.pdb release
if: ${{ matrix.os == 'windows-latest' }}
- name: Collect Rust Binaries (Linux)
working-directory: for-rust/target
run: cp ./x86_64-unknown-linux-gnu/release/vfusion ./release/VfusionNix
if: ${{ matrix.os == 'ubuntu-latest' }}
- name: Collect Rust Binaries (OSX)
working-directory: for-rust/target/release
run: cp vfusion VfusionMac
if: ${{ matrix.os == 'macos-latest' }}
- name: Upload Rust Artifacts
uses: actions/upload-artifact@v4
with:
name: rust-${{ matrix.os }}
path: |
for-rust/target/release/VfusionMac
for-rust/target/release/VfusionNix
for-rust/target/release/Vfusion.exe
build-fusion:
needs: [build-cli]
runs-on: windows-latest
steps:
- name: Print dotnet version
run: dotnet --info
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set Library Versions
run: dotnet run --set-version
- name: Build Fusion
run: dotnet run
- name: Download Rust OSX
uses: actions/download-artifact@v4
with:
name: rust-macos-latest
path: for-js/bin
- name: Download Rust Windows
uses: actions/download-artifact@v4
with:
name: rust-windows-latest
path: for-js/bin
- name: Download Rust Linux
uses: actions/download-artifact@v4
with:
name: rust-ubuntu-latest
path: for-js/bin
- name: Cargo Publish
working-directory: for-rust
if: github.ref == 'refs/heads/master'
run: |
cargo login ${{ secrets.CARGO_TOKEN }}
cargo publish --allow-dirty
- name: NPM Publish
working-directory: for-js
if: github.ref == 'refs/heads/master'
run: |
npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
npm publish --access public