-
Notifications
You must be signed in to change notification settings - Fork 3
127 lines (118 loc) · 4.25 KB
/
dotnet.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: .NET Build and Publish
on:
push:
branches: [ master ]
pull_request:
branches:
- "*"
permissions:
contents: write
jobs:
build_windows:
name: Build Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- uses: actions/cache@v3
with:
path: ~/.nuget/win-packages
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
win-nuget
- name: Publish Windows
run: |
./build.ps1 -Runtime win-x64 -PublishAot
New-Item -ItemType Directory -Path "win-x64"
Move-Item -Path ".\publish" -Destination "$env:GITHUB_WORKSPACE\win-x64\publish"
gci -path "$env:GITHUB_WORKSPACE\win-x64\publish"
shell: pwsh
- name: Create Package
run: tar -cvf keyvaultexplorer.win-x64.tar win-x64
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: keyvaultexplorer.win-x64
path: keyvaultexplorer.win-x64.tar
build_macos_intel:
name: Build macOS intel
runs-on: macos-12
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- uses: actions/cache@v3
with:
path: ~/.nuget/osx-intel-packages
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
mac-nuget
- name: publish_macOS_intel
run: |
./build.ps1 -Runtime osx-x64 -PublishAot -CreateMacOSBundle
New-Item -ItemType Directory -Path "osx-x64"
gci -recurse
Move-Item -Path "Key Vault Explorer.app" -Destination "$env:GITHUB_WORKSPACE\osx-x64\Key Vault Explorer.app"
shell: pwsh
- name: Create Package
run: tar -cvf keyvaultexplorer.osx-x64.tar osx-x64/
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: keyvaultexplorer.osx-x64
path: keyvaultexplorer.osx-x64.tar
build_macos:
name: Build macOS Arm64
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- uses: actions/cache@v3
with:
path: ~/.nuget/macos-arm-packages
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-armnuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
#mac-arm-nuget
- name: Publish macOS Arm
run: |
./build.ps1 -Runtime osx-arm64 -PublishAot:$false
New-Item -ItemType Directory -Path "osx-arm64"
Move-Item -Path ".\publish\keyvaultexplorerdesktop" -Destination "$env:GITHUB_WORKSPACE\osx-arm64\publish\keyvaultexplorerdesktop"
Rename-Item -Path "$env:GITHUB_WORKSPACE\osx-arm64\publish\keyvaultexplorerdesktop" -NewName "$env:GITHUB_WORKSPACE\osx-arm64\Azure Key Vault Explorer" -Force
shell: pwsh
- name: Create Package
run: tar -cvf keyvaultexplorer.osx-arm64.tar osx-arm64/
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: keyvaultexplorer.osx-arm64
path: keyvaultexplorer.osx-arm64.tar
release:
name: Release code
needs: [ build_macos, build_windows, build_macos_intel]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download built artifacts
uses: actions/download-artifact@v4
with:
pattern: keyvaultexplorer.*
- name: Create Release
run: |
Get-ChildItem -Recurse
gh release create v0.0.${{github.run_number }} --draft
gh release upload v0.0.${{github.run_number }} "./keyvaultexplorer.win-x64/keyvaultexplorer.win-x64.tar" "./keyvaultexplorer.osx-arm64/keyvaultexplorer.osx-arm64.tar" "./keyvaultexplorer.osx-x64/keyvaultexplorer.osx-x64.tar"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: pwsh