Skip to content

Commit 3858b4f

Browse files
committed
Build tools and upload to release
1 parent 24dbda6 commit 3858b4f

File tree

3 files changed

+107
-30
lines changed

3 files changed

+107
-30
lines changed

.github/workflows/build-tools.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Build Tools
2+
3+
on:
4+
push:
5+
branches: [master]
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: build-tools
10+
cancel-in-progress: true
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write
17+
steps:
18+
- name: Create or update release
19+
env:
20+
GH_TOKEN: ${{ github.token }}
21+
run: |
22+
NOTES="Automated tools build from ${GITHUB_SHA::7} on $(date -u +%Y-%m-%d)"
23+
gh release create tools --repo ${{ github.repository }} --title "Tools" --notes "$NOTES" --latest=false || \
24+
gh release edit tools --repo ${{ github.repository }} --notes "$NOTES"
25+
26+
build:
27+
needs: release
28+
strategy:
29+
matrix:
30+
include:
31+
- os: ubuntu-latest
32+
archive: tools-linux-x64.tar.gz
33+
- os: windows-latest
34+
archive: tools-win-x64.tar.gz
35+
36+
runs-on: ${{ matrix.os }}
37+
permissions:
38+
contents: write
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v6
42+
with:
43+
fetch-depth: 1
44+
45+
- name: Setup Go
46+
uses: actions/setup-go@v6
47+
with:
48+
go-version: 'stable'
49+
50+
- name: Setup .NET
51+
uses: actions/setup-dotnet@v5
52+
with:
53+
dotnet-version: '10.x'
54+
55+
- name: Build tools
56+
shell: bash
57+
run: ./tools/build.sh
58+
59+
- name: Create archive
60+
shell: bash
61+
run: ./tools/archive.sh "${{ matrix.archive }}"
62+
63+
- name: Upload to release
64+
env:
65+
GH_TOKEN: ${{ github.token }}
66+
run: gh release upload tools --repo ${{ github.repository }} --clobber tools/${{ matrix.archive }}

.github/workflows/gametracking.yml

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -33,52 +33,41 @@ jobs:
3333
permissions:
3434
contents: write
3535
statuses: write
36-
env:
37-
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
3836
steps:
3937

40-
# Checkout and cache
38+
# Checkout and download tools
4139

4240
- name: Checkout shared GameTracking
43-
id: checkout-gametracking
4441
uses: actions/checkout@v6
4542
with:
4643
fetch-depth: 1
4744
repository: 'SteamTracking/GameTracking'
4845

49-
- name: Restore tools cache
50-
id: cache
51-
uses: actions/cache@v5
52-
with:
53-
path: |
54-
${{ github.workspace }}/tools/*
55-
!${{ github.workspace }}/tools/build.sh
56-
key: ${{ runner.os }}-tools-${{ steps.checkout-gametracking.outputs.commit }}
46+
- name: Download pre-built tools
47+
shell: bash
48+
run: |
49+
if [[ "$(uname -s)" == MINGW* ]] || [[ "$(uname -s)" == MSYS* ]]; then
50+
ARCHIVE="tools-win-x64.tar.gz"
51+
else
52+
ARCHIVE="tools-linux-x64.tar.gz"
53+
fi
54+
55+
gh release download tools \
56+
--repo SteamTracking/GameTracking \
57+
--pattern "$ARCHIVE" \
58+
--dir .
59+
60+
tar xzf "$ARCHIVE" -C tools/
61+
rm "$ARCHIVE"
62+
env:
63+
GH_TOKEN: ${{ github.token }}
5764

5865
- name: Checkout game repository (${{ github.repository }})
5966
uses: actions/checkout@v6
6067
with:
6168
fetch-depth: 1
6269
path: tracked_game
6370

64-
- name: Setup Go
65-
if: steps.cache.outputs.cache-hit != 'true'
66-
uses: actions/setup-go@v6
67-
with:
68-
go-version: 'stable'
69-
cache-dependency-path: tools/*/go.sum
70-
71-
- name: Setup .NET
72-
if: steps.cache.outputs.cache-hit != 'true'
73-
uses: actions/setup-dotnet@v5
74-
with:
75-
dotnet-version: '10.x'
76-
77-
- name: Build tools
78-
if: steps.cache.outputs.cache-hit != 'true'
79-
shell: bash
80-
run: ./tools/build.sh
81-
8271
# Optional Node.js setup
8372

8473
- name: Check for package-lock.json

tools/archive.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
if [[ $# -ne 1 ]]; then
5+
echo "Usage: $(basename "$0") <output archive>"
6+
exit 1
7+
fi
8+
9+
cd "${0%/*}"
10+
11+
. ../common.sh no-git
12+
13+
PATHS=(exe/)
14+
15+
if [[ -n "$EXE_SUFFIX" ]]; then
16+
PATHS+=(DumpSource2/build/Release/)
17+
else
18+
PATHS+=(DumpSource2/build/DumpSource2-*)
19+
PATHS+=(implib/)
20+
fi
21+
22+
tar --create --gzip --file "$1" --exclude='*.pdb' "${PATHS[@]}"

0 commit comments

Comments
 (0)