Merge pull request #87 from cubernetes/master #58
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |