-
Notifications
You must be signed in to change notification settings - Fork 4
84 lines (70 loc) · 2.52 KB
/
main.yml
File metadata and controls
84 lines (70 loc) · 2.52 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
83
84
on:
push:
branches:
- main
permissions:
contents: read
name: main
jobs:
build:
name: Build MagickViewer
runs-on: windows-2022
permissions:
id-token: write
outputs:
has-tag: ${{ steps.check-tag.outputs.has-tag }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
with:
fetch-tags: true
persist-credentials: false
- name: Check if commit has tag
if: github.event_name != 'pull_request'
id: check-tag
shell: powershell
run: |
$tag = git tag --points-at HEAD
if ($tag) {
echo "Tag found: $tag"
echo "has-tag=true" >> $env:GITHUB_OUTPUT
} else {
echo "No tag found"
echo "has-tag=false" >> $env:GITHUB_OUTPUT
}
- name: Setup MSBuild
uses: microsoft/setup-msbuild@30375c66a4eea26614e0d39710365f22f8b0af57 #v3.0.0
- name: Restore NuGet packages
run: nuget restore MagickViewer/packages.config -PackagesDirectory packages
- name: Build
run: msbuild MagickViewer.sln /p:Configuration=Release /p:Platform="Any CPU"
- name: Publish
run: msbuild MagickViewer.sln /p:Configuration=Release /p:Platform="Any CPU" /p:PublishClickOnce=true /t:PublishClickOnce
- name: Sign executables and libraries
uses: ImageMagick/code-signing-action@11c51f7659405bee4dd3529748e1501a0d388911 #v1.0.1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
directory: ${{ github.workspace }}\MagickViewer\bin\Release\app.publish
files: 'MagickViewer.application'
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
with:
name: MagickViewer
path: MagickViewer\bin\Release\app.publish\**
deploy:
name: Deploy MagickViewer
runs-on: windows-2022
needs: build
if: needs.build.outputs.has-tag == 'true'
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c #v8.0.1
with:
name: MagickViewer
path: MagickViewer
- name: Deploy to Azure Web App
uses: azure/webapps-deploy@02a81bead70021f5284939794bcec79c271ab383 #3.0.8
with:
app-name: magickviewer
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: MagickViewer