-
Notifications
You must be signed in to change notification settings - Fork 14
51 lines (46 loc) · 1.7 KB
/
publish.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
name: Publish Build
on:
push:
branches: [ "main" ]
workflow_dispatch:
jobs:
release-and-publish:
env:
NUGET_VERSION_MAJOR: 0
NUGET_VERSION_MINOR: 1
NUGET_VERSION_PATCH: ${{ github.run_number }}
runs-on: windows-2022
name: Swift/WinRT Release Build & Publish
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: ./.github/actions/windows-build
env:
NUGET_VERSION: ${{ env.NUGET_VERSION_MAJOR }}.${{ env.NUGET_VERSION_MINOR }}.${{ env.NUGET_VERSION_PATCH }}
with:
config: release
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Nuget
shell: cmd
run: |
cmake --build --preset release --target nuget
- name: Publish NuGet Package
shell: cmd
env:
GITHUB_TOKEN: ${{ secrets.NUGET_TOKEN }}
GITHUB_USERNAME: thebrowsercompany-bot2
NUGET_PUBLISH_URL: https://nuget.pkg.github.com/thebrowsercompany/index.json
NUGET_SOURCE_NAME: TheBrowserCompany
run: |
set PATH=%PATH%;%GITHUB_WORKSPACE%\build\release
nuget sources list | find "%NUGET_SOURCE_NAME%"
if errorlevel 0 (
nuget sources remove -name %NUGET_SOURCE_NAME%
)
nuget sources Add -Name %NUGET_SOURCE_NAME% -Source %NUGET_PUBLISH_URL% -username %GITHUB_USERNAME% -password %GITHUB_TOKEN% -StorePasswordInClearText
nuget setApiKey %GITHUB_TOKEN% -Source %NUGET_PUBLISH_URL%
nuget push %GITHUB_WORKSPACE%\build\release\*.nupkg -Source %NUGET_SOURCE_NAME%