Skip to content

Merge pull request #117 from jakobFNF/patch-1 #126

Merge pull request #117 from jakobFNF/patch-1

Merge pull request #117 from jakobFNF/patch-1 #126

Workflow file for this run

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%