This repository has been archived by the owner on Oct 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (77 loc) · 2.91 KB
/
build-wasm-and-linux-binaries.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
name: build-wasm-and-linux-binaries
on:
push:
branches: ["main"]
paths:
- 'Starship/**'
- '.github/workflows/build-wasm-and-linux-binaries.yml'
- '.github/workflows/build-windows-binary.yml'
- '.github/workflows/build-macos-binary.yml'
workflow_dispatch:
workflow_call:
concurrency:
group: "build-wasm-and-linux-binaries"
cancel-in-progress: true
jobs:
build-engine:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up .NET 8 SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: Install .NET WASM workloads
working-directory: ./Starship
run: dotnet workload install wasm-tools
- name: Get Next Version
id: semver
uses: ietf-tools/semver-action@v1
with:
token: ${{ github.token }}
branch: main
- name: "Display build version"
run: echo "tag ${{ steps.semver.outputs.next }}"
- name: Patch VERSION constant inside Starship/Rockstar.Engine/RockstarEnvironment.cs
run: sed -i 's/VERSION = "[^"]*";/VERSION = "${{ steps.semver.outputs.next }}";/g' Starship/Rockstar.Engine/RockstarEnvironment.cs
- name: Build Rockstar
run: dotnet build Starship -c Release
- name: Test Rockstar
run: dotnet test Starship -c Release
- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
tag: ${{ github.ref_name }}
- name: Commit changes with new version
run: |
git config --global user.name 'workflows/build-wasm-and-linux-binaries.yml'
git config --global user.email '[email protected]'
git commit -am "[skip actions] set VERSION = ${{ steps.semver.outputs.next }} in RockstarEnvironment.cs"
git push
- name: dotnet publish WASM engine
run: dotnet publish Starship/Rockstar.Wasm -o rockstar-wasm-binary -c Release
- name: dotnet publish Linux binary
run: dotnet publish Starship/Rockstar -o rockstar-linux-x64-binary -c Release
- uses: actions/cache/save@v4
name: save rockstar-wasm-binary to cache
id: save-rockstar-wasm-binary-to-cache
with:
enableCrossOsArchive: true
path: rockstar-wasm-binary
key: rockstar-wasm-binary-${{ github.run_id }}
- uses: actions/cache/save@v4
name: save rockstar-linux-x64-binary to cache
id: save-rockstar-linux-x64-binary-to-cache
with:
enableCrossOsArchive: true
path: rockstar-linux-x64-binary
key: rockstar-linux-x64-binary-${{ github.run_id }}
rockstar-macos-binary:
needs: build-engine
uses: ./.github/workflows/build-macos-binary.yml
rockstar-windows-binary:
needs: build-engine
uses: ./.github/workflows/build-windows-binary.yml