-
Notifications
You must be signed in to change notification settings - Fork 56
65 lines (55 loc) · 1.75 KB
/
release.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
name: Release
on:
push:
tags: [ 'v*' ]
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: microsoft/setup-msbuild@v1.1
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
cache-dependency-path: Sprinkles/package-lock.json
- name: Fetch external dependencies
run: ./fetch_external_deps.bat
- name: Build Natives
run: |
vcpkg install --triplet x86-windows-static-md
vcpkg integrate install
msbuild /p:Configuration=Release
- name: Build TypeScript
run: |
cd Sprinkles/
$Env:NODE_ENV = "production"
$Env:VERSION_INFO = $Env:GITHUB_REF_NAME + "-" + $Env:GITHUB_SHA.Substring(0, 8);
npm install
npm run build
Copy-Item dist/bundle.js ../build/Release/Soggfy.js
Copy-Item dist/bundle.js.map ../build/Release/Soggfy.js.map
cd ../
- name: Create Zip
run: |
echo $Env:GITHUB_REF_NAME;
if ($Env:GITHUB_REF_TYPE -eq "tag") {
$ver = $Env:GITHUB_REF_NAME -replace "^v", "";
} else {
$ver = $Env:GITHUB_SHA.Substring(0, 8) + "-pre";
}
Rename-Item -Path ./build/Release -NewName Soggfy-$ver
7z a "-xr!*.lib" "-xr!*.exp" "-xr!*.pdb" build/Soggfy-$ver.zip ./build/Soggfy-$ver
- name: Upload Binaries
uses: softprops/action-gh-release@v1
if: ${{ github.ref_type == 'tag' }}
with:
draft: false
prerelease: ${{ contains(github.ref_name, '-pre') }}
files: 'build/*.zip'
- name: Upload Artifacts
uses: actions/upload-artifact@v2
if: ${{ github.ref_type != 'tag' }}
with:
path: build/*.zip