-
Notifications
You must be signed in to change notification settings - Fork 225
87 lines (85 loc) · 3.41 KB
/
build-rockstar-2.0.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
name: build-rockstar-2.0
on:
push:
branches: ["main"]
paths:
- 'Starship/**'
- '.github/workflows/build-rockstar-*.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 9 SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.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
# noVersionBumpBehavior: patch
- name: "Display build version"
# run: echo "tag v2.0.0-beta.${{ steps.semver.outputs.nextStrict }}"
run: echo "tag v2.0.${{ github.run_number }}"
- name: Patch VERSION constant inside Starship/Rockstar.Engine/RockstarEnvironment.cs
# run: sed -i 's/VERSION = "[^"]*";/VERSION = "v2.0.0-beta.${{ steps.semver.outputs.nextStrict }}";/g' Starship/Rockstar.Engine/RockstarEnvironment.cs
run: sed -i 's/VERSION = "[^"]*";/VERSION = "v2.0.${{ github.run_number }}";/g' Starship/Rockstar.Engine/RockstarEnvironment.cs
# run: sed -i 's/VERSION = "[^"]*";/VERSION = "v2.0.0";/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 'dylanbeattie@users.noreply.github.com'
git commit -am "[skip actions] set VERSION = v2.0.${{ github.run_number }} 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
with:
rockstar_version: "v2.0.${{ github.run_number }}"
rockstar-windows-binary:
needs: build-engine
uses: ./.github/workflows/build-windows-binary.yml
with:
rockstar_version: "v2.0.${{ github.run_number }}"