-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (81 loc) · 3.26 KB
/
publish.yaml
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
name: Publish
on:
workflow_call:
inputs:
version:
description: "Build version."
required: true
type: string
storageAccountName:
description: "Target storage account name."
required: true
type: string
blobsContainerName:
description: "Container name to upload add-on packages."
required: true
type: string
nugetSourceUrl:
description: "Target source URL to upload NuGet packages."
required: true
type: string
archiveFileShareName:
description: "File share name to archive packages."
required: false
type: string
default: archive
nugetArtifactDirectory:
description: "Download directory for nuget packages."
required: false
type: string
default: nuget
addOnArtifactDirectory:
description: "Download directory for add-on packages."
required: false
type: string
default: add-ons
secrets:
archiveSasToken:
required: true
blobContainerSasToken:
required: true
nugetToken:
required: true
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.x'
source-url: ${{ inputs.nugetSourceUrl }}
env:
NUGET_AUTH_TOKEN: ${{ secrets.nugetToken }}
- name: Download NuGet artifacts
uses: actions/download-artifact@v3
with:
name: NuGets ${{ inputs.version }}
path: ${{ inputs.nugetArtifactDirectory }}
- name: Download Add-on artifacts
uses: actions/download-artifact@v3
with:
name: Add-ons ${{ inputs.version }}
path: ${{ inputs.addOnArtifactDirectory }}
- name: Upload to archive file share
if: success()
uses: azure/CLI@v1
with:
inlineScript: |
az storage directory create --name add-ons/XRV/${{ inputs.version }} --share-name ${{ inputs.archiveFileShareName }} --account-name ${{ inputs.storageAccountName }} --sas-token "${{ secrets.archiveSasToken }}"
az storage file upload-batch --destination ${{ inputs.archiveFileShareName }} --destination-path add-ons/XRV/${{ inputs.version }} --source ${{ inputs.nugetArtifactDirectory }} --account-name ${{ inputs.storageAccountName }} --sas-token "${{ secrets.archiveSasToken }}"
az storage file upload-batch --destination ${{ inputs.archiveFileShareName }} --destination-path add-ons/XRV/${{ inputs.version }} --source ${{ inputs.addOnArtifactDirectory }} --account-name ${{ inputs.storageAccountName }} --sas-token "${{ secrets.archiveSasToken }}"
- name: Upload to public blob container
if: success()
uses: azure/CLI@v1
with:
inlineScript: |
az storage blob upload-batch --destination ${{ inputs.blobsContainerName }} --source ${{ inputs.addOnArtifactDirectory }} --account-name ${{ inputs.storageAccountName }} --sas-token "${{ secrets.blobContainerSasToken }}"
- name: Push NuGets
if: success()
run: |
dotnet nuget push "${{ inputs.nugetArtifactDirectory }}/**/*.nupkg" --skip-duplicate --no-symbols --api-key "${{ secrets.nugetToken }}"