-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (115 loc) · 3.39 KB
/
release.yml
File metadata and controls
134 lines (115 loc) · 3.39 KB
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
133
134
name: Release
on:
push:
branches: [main]
permissions:
contents: write
jobs:
tag:
runs-on: ubuntu-latest
outputs:
new_tag: ${{ steps.tag.outputs.new_tag }}
new_version: ${{ steps.tag.outputs.new_version }}
changelog: ${{ steps.tag.outputs.changelog }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Bump version and push tag
id: tag
uses: mathieudutour/github-tag-action@v6.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: false
tag_prefix: v
build-linux:
needs: tag
if: needs.tag.outputs.new_tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake pkg-config \
libxxhash-dev libtbb-dev
- name: Configure
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build build -j$(nproc)
- name: Package
run: |
mkdir -p forge-linux
cp build/forge forge-linux/
tar czf forge-linux-x86_64.tar.gz -C forge-linux .
- uses: actions/upload-artifact@v4
with:
name: forge-linux-x86_64
path: forge-linux-x86_64.tar.gz
build-windows:
needs: tag
if: needs.tag.outputs.new_tag
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-cmake
mingw-w64-x86_64-xxhash
mingw-w64-x86_64-tbb
- name: Configure
run: |
cmake -B build -G "MinGW Makefiles" \
-DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build build -j$(nproc)
- name: Package
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path forge-windows
Copy-Item build/forge.exe forge-windows/
$mingw = "D:\a\_temp\msys64\mingw64\bin"
$dlls = @(
"libtbb12.dll",
"libxxhash.dll",
"libgcc_s_seh-1.dll",
"libstdc++-6.dll",
"libwinpthread-1.dll"
)
foreach ($dll in $dlls) {
$path = Join-Path $mingw $dll
if (Test-Path $path) {
Copy-Item $path forge-windows/
}
}
Compress-Archive -Path forge-windows/* -DestinationPath forge-windows-x86_64.zip
- uses: actions/upload-artifact@v4
with:
name: forge-windows-x86_64
path: forge-windows-x86_64.zip
release:
needs: [tag, build-linux, build-windows]
if: needs.tag.outputs.new_tag
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: forge-linux-x86_64
- uses: actions/download-artifact@v4
with:
name: forge-windows-x86_64
- uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.tag.outputs.new_tag }}
name: ${{ needs.tag.outputs.new_tag }}
body: ${{ needs.tag.outputs.changelog }}
files: |
forge-linux-x86_64.tar.gz
forge-windows-x86_64.zip