-
-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (69 loc) · 2.2 KB
/
build-and-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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Build and Release
on:
push:
branches:
- '**'
tags:
- v**
jobs:
build:
name: Build Package
runs-on: windows-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.x"
- name: Set up MSBuild
uses: microsoft/setup-msbuild@v2
- name: Install windows 10 SDK
uses: GuillaumeFalourd/setup-windows10-sdk-action@v2
with:
sdk-version: '22000'
- name: Add Win10 SDK to PATH
run: |
Add-Content $env:GITHUB_PATH "C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64"
- name: Install code signing certificate
env:
base64Pfx: ${{ secrets.PFX_B64 }}
password: ${{ secrets.PFX_PASS }}
run: |
$securePassword = ConvertTo-SecureString -String $env:password -AsPlainText -Force
$pfxBytes = [System.Convert]::FromBase64String($env:base64Pfx)
$tempPfxPath = [System.IO.Path]::GetTempFileName()
[System.IO.File]::WriteAllBytes($tempPfxPath, $pfxBytes)
Import-PfxCertificate -FilePath $tempPfxPath -CertStoreLocation Cert:\CurrentUser\My -Password $securePassword
- name: Run package script
shell: pwsh
run: |
./package.ps1
mkdir -Force dist
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
release:
name: Release Package
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: dist
- name: "Upload to R2"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: auto
AWS_ENDPOINT_URL: ${{ secrets.S3_ENDPOINT_URL }}
run: |
aws s3 sync ./ s3://tsc/
- name: Create a new release
uses: softprops/action-gh-release@v2
with:
files: TailscaleClient*