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 2
132 lines (107 loc) · 3.85 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Build
on: [ push, pull_request ]
jobs:
build-fusion:
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: Cargo Publish
working-directory: for-rust
if: github.ref == 'refs/heads/master'
run: |
cargo login ${{ secrets.CARGO_TOKEN }}
cargo publish --allow-dirty
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: vfusion-cli-${{ matrix.os }}
path: |
for-rust/target/release/VfusionMac
for-rust/target/release/VfusionNix
for-rust/target/release/*.exe
# package:
# runs-on: ubuntu-latest
# needs: [build]
# steps:
# - name: Print dotnet version
# run: dotnet --info
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - uses: actions/cache@v4
# with:
# path: ~/.nuget/packages
# key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
# restore-keys: ${{ runner.os }}-nuget-
# - name: Download Rust OSX
# uses: actions/download-artifact@v4
# with:
# name: rust-macos-latest
# path: for-rust/target/release
# - name: Download Rust Windows
# uses: actions/download-artifact@v4
# with:
# name: rust-windows-latest
# path: for-rust/target/release
# - name: Download Rust Linux
# uses: actions/download-artifact@v4
# with:
# name: rust-ubuntu-latest
# path: for-rust/target/release
# - name: Build .NET
# run: dotnet build -c Release /p:PackRustAssets=true
# - name: Upload Package Artifacts
# uses: actions/upload-artifact@v4
# with:
# name: packages
# path: build/Release/*.nupkg
# - name: Publish to GitHub Packages
# shell: pwsh
# run: dotnet nuget push build/Release/*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --skip-duplicate