forked from unosquare/passcore
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (56 loc) · 2.22 KB
/
Copy pathbuild_windows.yml
File metadata and controls
67 lines (56 loc) · 2.22 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
name: Build Windows Binaries
on:
workflow_dispatch:
push:
tags:
- 'v*.*.*' # Trigger workflow on tags like v1.0.0, v2.0.1, etc.
jobs:
build:
name: Windows Binaries on Windows Latest
runs-on: windows-latest
steps:
- name: Cancel previous runs on the same branch
if: ${{ github.ref != 'refs/heads/main' }}
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout Code
uses: actions/[email protected]
with:
fetch-depth: 0
submodules: recursive
- name: Set git urls to https instead of ssh
run: |
git config --global url."https://github.com/".insteadOf ssh://[email protected]/
- name: Setup Node
uses: actions/[email protected]
with:
node-version: 22
- name: Extract version from tag
if: startsWith(github.ref, 'refs/tags/v')
id: extract_version
shell: pwsh # Use PowerShell for Windows compatibility
run: |
$tagName = "${GITHUB_REF_NAME}"
$versionNumber = $tagName.Substring(1) # Remove the leading 'v' using PowerShell
Write-Host "Extracted version: $versionNumber"
echo "version=$versionNumber" >> "$env:GITHUB_OUTPUT" # Set output variable for Windows
- name: Set package.json version
if: startsWith(github.ref, 'refs/tags/v')
run: npm version ${{ steps.extract_version.outputs.version }} WorkingDirectory=".\ClientApp"
- name: Build Windows binaries with MS vc15
run: |
$env:path="C:\Program` Files` (x86)\Microsoft` Visual` Studio\2019\Enterprise\SDK\ScopeCppSDK\vc15\VC\bin\;$env:path"
dotnet publish --configuration Release --runtime win-x64 --output ".\passcore_output\"
ls ${{ github.workspace }}\passcore_output\
- name: Upload Windows binaries to artifacts
uses: actions/[email protected]
with:
name: passcore
path: ${{ github.workspace }}\passcore_output\
- name: Get tag name
if: startsWith(github.ref, 'refs/tags/')
id: tag-name
run: |
echo "::set-output name=TAG_NAME::$(echo ${{ github.ref }} | cut -d'/' -f 3)"
echo "::set-output name=REPO_NAME::$(echo ${{ github.repository }} | cut -d'/' -f 2)"