-
Notifications
You must be signed in to change notification settings - Fork 3
154 lines (145 loc) · 5.42 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: .NET Build and Publish
on:
push:
branches: [ master ]
workflow_dispatch:
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 -BuildNumber '1.0.${{github.run_number }}'
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 -BuildNumber '1.0.${{github.run_number }}'
New-Item -ItemType Directory -Path "osx-x64"
Move-Item -Path "Key Vault Explorer for Azure.app" -Destination "$env:GITHUB_WORKSPACE\osx-x64\Key Vault Explorer for Azure.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 -BuildNumber '1.0.${{github.run_number }}'
New-Item -ItemType Directory -Path "osx-arm64"
Move-Item -Path ".\publish" -Destination "$env:GITHUB_WORKSPACE\osx-arm64\publish"
Rename-Item -Path "$env:GITHUB_WORKSPACE\osx-arm64\publish\keyvaultexplorerdesktop" -NewName "Key Vault Explorer for Azure" -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
build_linux:
name: Build Linux
runs-on: ubuntu-20.04
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/linux-packages
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
linux-nuget
- name: Publish Linux
run: |
./build.ps1 -Runtime linux-x64 -PublishAot:$false -BuildNumber '1.0.${{github.run_number }}'
New-Item -ItemType Directory -Path "linux-x64"
Move-Item -Path ".\publish" -Destination "$env:GITHUB_WORKSPACE\linux-x64\publish"
gci -path "$env:GITHUB_WORKSPACE\linux-x64\publish"
shell: pwsh
- name: Create Package
run: tar -cvf keyvaultexplorer.linux-x64.tar linux-x64
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: keyvaultexplorer.linux-x64
path: keyvaultexplorer.linux-x64.tar
release:
name: Release code
needs: [ build_macos, build_windows, build_macos_intel, build_linux]
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 v1.0.${{github.run_number }} --draft
gh release upload v1.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" "./keyvaultexplorer.linux-x64/keyvaultexplorer.linux-x64.tar"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: pwsh