forked from jedisct1/libsodium
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (50 loc) · 1.84 KB
/
bcny-release.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
name: Build and release nuget package
on:
workflow_dispatch:
jobs:
build_nuget_package:
strategy:
fail-fast: false
matrix:
include:
- arch: 'amd64'
platform: 'x64'
- arch: 'arm64'
platform: 'ARM64'
name: "Build nuget package ${{ matrix.arch }}"
uses: ./.github/workflows/bcny-build-nuget-package.yml
with:
arch: ${{ matrix.arch }}
platform: ${{ matrix.platform }}
publish_nuget_package:
name: "Publish nuget package"
runs-on: windows-latest
needs: build_nuget_package
strategy:
fail-fast: false
matrix:
include:
- arch: 'amd64'
platform: 'x64'
- arch: 'arm64'
platform: 'ARM64'
env:
NUGET_SOURCE_NAME: TheBrowserCompany
NUGET_SOURCE_URL: https://nuget.pkg.github.com/thebrowsercompany/index.json
NUGET_SOURCE_USERNAME: thebrowsercompany-bot2
NUGET_SOURCE_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
NUGET_API_KEY: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/download-artifact@v3
with:
name: windows-${{ matrix.arch }}.nupkg
- name: "Upload nuget package ${{ matrix.arch }}"
run: |
if ((nuget sources List | Select-String "${env:NUGET_SOURCE_NAME}").Count -gt 0) {
nuget sources Remove -Name "${env:NUGET_SOURCE_NAME}"
}
nuget sources Add -Name ${env:NUGET_SOURCE_NAME} -Source ${env:NUGET_SOURCE_URL} -Username ${env:NUGET_SOURCE_USERNAME} -Password ${env:NUGET_SOURCE_PASSWORD} -StorePasswordInClearText
nuget setApiKey ${env:NUGET_API_KEY} -Source ${env:NUGET_SOURCE_URL}
$pkgs = Get-ChildItem -Path org.libsodium.libsodium.windows.${{ matrix.arch }}.*.nupkg
nuget push $pkgs[0].Name -Source ${env:NUGET_SOURCE_URL} -SkipDuplicate
shell: pwsh