diff --git a/.github/workflows/bcny-release.yml b/.github/workflows/bcny-release.yml index 733a1ee74e..a71652681c 100644 --- a/.github/workflows/bcny-release.yml +++ b/.github/workflows/bcny-release.yml @@ -2,9 +2,6 @@ name: Release nuget package on: workflow_dispatch: - pull_request: - branches: - - master jobs: windows: @@ -17,7 +14,7 @@ jobs: - arch: 'amd64' platform: 'x64' - arch: 'arm64' - platform: 'arm64' + platform: 'ARM64' steps: - uses: actions/checkout@v4 @@ -46,159 +43,118 @@ jobs: run: msbuild .\builds\msvc\vs2022\libsodium.sln /p:Configuration=LtcgRelease /p:Platform=${{ matrix.platform }} - # - name: Package firebase-cpp-sdk - # run: | - # @" - # - # - # - # com.google.firebase.windows.${{ matrix.arch }} - # 0.0.0.0 - # Firebase C++ SDK - # C++ Firebase SDK - # Google, Inc. - # https://firebase.google.com - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # "@ | Out-File -Encoding UTF8 firebase.nuspec - # nuget pack -Properties BUILDROOT=${{ github.workspace }}\BuildRoot\Library\firebase -Suffix (git -C ${{ github.workspace }}/SourceCache/firebase-cpp-sdk log -1 --format=%h) firebase.nuspec - # shell: pwsh - # - uses: actions/upload-artifact@v3 - # with: - # name: windows-${{ matrix.arch }}.nupkg - # path: com.google.firebase.windows.${{ matrix.arch }}.*.nupkg + - name: Package libsodium + run: | + @" + + + + org.libsodium.libsodium.windows.${{ matrix.arch }} + 0.0.0 + libsodium + libsodium + org.libsodium + https://libsodium.org + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "@ | Out-File -Encoding UTF8 libsodium.nuspec + nuget pack -Suffix (git log -1 --format=%h) libsodium.nuspec + shell: pwsh - # - name: Publish NuGet Packages - # 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 }} - # 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 com.google.firebase.windows.${{ matrix.arch }}.*.nupkg - # nuget push $pkgs[0].Name -Source ${env:NUGET_SOURCE_URL} -SkipDuplicate - # shell: pwsh \ No newline at end of file + - uses: actions/upload-artifact@v3 + with: + name: windows-${{ matrix.arch }}.nupkg + path: org.libsodium.libsodium.windows.${{ matrix.arch }}.*.nupkg + + - name: Publish NuGet Packages + 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 }} + 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 \ No newline at end of file diff --git a/.github/workflows/bcny-validate.yml b/.github/workflows/bcny-validate.yml new file mode 100644 index 0000000000..ecdfe1ef3a --- /dev/null +++ b/.github/workflows/bcny-validate.yml @@ -0,0 +1,145 @@ +name: Validate nuget package + +on: + pull_request: + branches: + - master + +jobs: + windows: + runs-on: windows-latest + + strategy: + fail-fast: false + matrix: + include: + - arch: 'amd64' + platform: 'x64' + - arch: 'arm64' + platform: 'ARM64' + + steps: + - uses: actions/checkout@v4 + + - uses: compnerd/gha-setup-vsdevenv@main + with: + host_arch: amd64 + components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64' + arch: ${{ matrix.arch }} + + - uses: actions/setup-python@v4 + id: python + with: + python-version: 3.9 + architecture: 'x64' + + - name: Build StaticRelease + run: + msbuild .\builds\msvc\vs2022\libsodium.sln /p:Configuration=StaticRelease /p:Platform=${{ matrix.platform }} + + - name: Build DynRelease + run: + msbuild .\builds\msvc\vs2022\libsodium.sln /p:Configuration=DynRelease /p:Platform=${{ matrix.platform }} + + - name: Build LtcgRelease + run: + msbuild .\builds\msvc\vs2022\libsodium.sln /p:Configuration=LtcgRelease /p:Platform=${{ matrix.platform }} + + - name: Package libsodium + run: | + @" + + + + org.libsodium.libsodium.windows.${{ matrix.arch }} + 0.0.0 + libsodium + libsodium + org.libsodium + https://libsodium.org + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "@ | Out-File -Encoding UTF8 libsodium.nuspec + nuget pack -Suffix (git log -1 --format=%h) libsodium.nuspec + shell: pwsh + + - uses: actions/upload-artifact@v3 + with: + name: windows-${{ matrix.arch }}.nupkg + path: org.libsodium.libsodium.windows.${{ matrix.arch }}.*.nupkg