-
Notifications
You must be signed in to change notification settings - Fork 7
82 lines (66 loc) · 3.1 KB
/
Copy pathdeploy.yml
File metadata and controls
82 lines (66 loc) · 3.1 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
name: Deploy
on:
push:
branches:
- master
permissions:
contents: write
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Install MAUI Workload
run: dotnet workload install maui
- name: Restore
run: dotnet restore
working-directory: ./ContinuousDeployment
- name: Build
run: dotnet build -c Release -f:net8.0-windows10.0.19041.0
working-directory: ./ContinuousDeployment
- name: Decode Signing Certificate
run: |
echo "${{ secrets.SIGNING_CERTIFICATE_BASE_64_CONTENT }}" > cert.asc
certutil -decode cert.asc cert.pfx
- name: Install Signing Certficiate
run: certutil -user -p ${{ secrets.SIGNING_CERTIFICATE_PASSWORD }} -Silent -importpfx cert.pfx NoRoot
- name: Publish
run: dotnet publish -c Release -f:net8.0-windows10.0.19041.0 /p:GenerateAppxPackageOnBuild=true /p:AppxPackageSigningEnabled=true /p:PackageCertificateThumbprint=${{ secrets.SIGNING_CERTIFICATE_THUMBPRINT }}
working-directory: ./ContinuousDeployment
- name: Extract Version
id: extractVersion
shell: pwsh
run: |
$xml = [Xml] (Get-Content ./ContinuousDeployment/ContinuousDeployment.csproj)
[string] $version = [Version] $xml.Project.PropertyGroup.ApplicationDisplayVersion
echo "version=$($version)" >> $env:GITHUB_OUTPUT
- name: Create Tag
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.sha,
ref: 'refs/tags/v${{ steps.extractVersion.outputs.version }}'
})
- name: Rename Auto-Update Installer
shell: pwsh
run: Rename-Item ./ContinuousDeployment/bin/Release/net8.0-windows10.0.19041.0/win10-x64/AppPackages/ContinuousDeployment_${{ steps.extractVersion.outputs.version }}.0_Test/ContinuousDeployment_${{ steps.extractVersion.outputs.version }}.0_x64.msix AutoUpdate.msix
- name: Rename Certificate
shell: pwsh
run: Rename-Item ./ContinuousDeployment/bin/Release/net8.0-windows10.0.19041.0/win10-x64/AppPackages/ContinuousDeployment_${{ steps.extractVersion.outputs.version }}.0_Test/ContinuousDeployment_${{ steps.extractVersion.outputs.version }}.0_x64.cer ContinuousDeployment.cer
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.extractVersion.outputs.version }}
files: |
./ContinuousDeployment/ContinuousDeployment.appinstaller
./ContinuousDeployment/bin/Release/net8.0-windows10.0.19041.0/win10-x64/AppPackages/ContinuousDeployment_${{ steps.extractVersion.outputs.version }}.0_Test/AutoUpdate.msix
./ContinuousDeployment/bin/Release/net8.0-windows10.0.19041.0/win10-x64/AppPackages/ContinuousDeployment_${{ steps.extractVersion.outputs.version }}.0_Test/ContinuousDeployment.cer