Update VCPKG to 2025.10.17 #331
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Bundle packages | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| - v*.*.* | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| DOTNET_INSTALL_DIR: ${{ github.workspace }}/.dotnet | |
| DOTNET_VERSION: "9.0.x" | |
| IS_PRE_RELEASE: ${{ !(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/v')) }} | |
| jobs: | |
| env-context: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| is-pre-release: ${{ steps.set.outputs.is_pre_release }} | |
| dotnet-version: ${{ steps.set.outputs.dotnet_version }} | |
| is-version-branch: ${{ steps.set.outputs.is_version_branch }} | |
| skip-unix: ${{ steps.set.outputs.skip_unix }} | |
| skip-windows: ${{ steps.set.outputs.skip_windows }} | |
| skip-osx: ${{ steps.set.outputs.skip_osx }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/[email protected] | |
| with: | |
| ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} | |
| - name: Set env for the reusable workflows | |
| id: set | |
| run: | | |
| echo "is_pre_release=$IS_PRE_RELEASE" >> $GITHUB_OUTPUT | |
| echo "dotnet_version=$DOTNET_VERSION" >> $GITHUB_OUTPUT | |
| if [[ ${{ github.ref }} =~ ^refs/heads/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
| echo "is_version_branch=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "is_version_branch=false" >> $GITHUB_OUTPUT | |
| fi; | |
| # Skip build for specific OS | |
| git log -1 --pretty=format:"%B" | cat | |
| for os in unix windows osx; do | |
| if git log -1 --pretty=format:"%B" | grep -Eq "\[(skip|no) $os\]|\[$os skip\]"; then | |
| echo "skip_$os=true" >> $GITHUB_OUTPUT | |
| echo "Skip build for $os" | |
| else | |
| echo "skip_$os=false" >> $GITHUB_OUTPUT | |
| echo "Building for $os" | |
| fi | |
| done | |
| LinuxBuild: | |
| needs: env-context | |
| uses: ./.github/workflows/unix.yml | |
| secrets: inherit | |
| with: | |
| is-pre-release: ${{ fromJSON(needs.env-context.outputs.is-pre-release) }} | |
| dotnet-version: ${{ needs.env-context.outputs.dotnet-version }} | |
| is-version-branch: ${{ fromJSON(needs.env-context.outputs.is-version-branch) }} | |
| skip: ${{ fromJSON(needs.env-context.outputs.skip-unix) }} | |
| WindowsBuild: | |
| needs: env-context | |
| uses: ./.github/workflows/windows.yml | |
| secrets: inherit | |
| with: | |
| is-pre-release: ${{ fromJSON(needs.env-context.outputs.is-pre-release) }} | |
| dotnet-version: ${{ needs.env-context.outputs.dotnet-version }} | |
| is-version-branch: ${{ fromJSON(needs.env-context.outputs.is-version-branch) }} | |
| skip: ${{ fromJSON(needs.env-context.outputs.skip-windows) }} | |
| MacOSBuild: | |
| needs: env-context | |
| uses: ./.github/workflows/macos.yml | |
| secrets: inherit | |
| with: | |
| is-pre-release: ${{ fromJSON(needs.env-context.outputs.is-pre-release) }} | |
| dotnet-version: ${{ needs.env-context.outputs.dotnet-version }} | |
| is-version-branch: ${{ fromJSON(needs.env-context.outputs.is-version-branch) }} | |
| skip: ${{ fromJSON(needs.env-context.outputs.skip-osx) }} | |
| TestAndPushPackages: | |
| needs: [env-context, LinuxBuild, WindowsBuild, MacOSBuild] | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] | |
| defaults: | |
| run: | |
| working-directory: unix | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/[email protected] | |
| with: | |
| repository: ${{ github.event.pull_request.head.repo.full_name }} | |
| ref: ${{ github.event.pull_request.head.ref }} | |
| - name: NuGet - set credentials | |
| uses: ./.github/actions/set-credentials | |
| with: | |
| api-key-github: ${{ secrets.API_KEY_GITHUB }} | |
| api-key-nuget: ${{ secrets.API_KEY_NUGET }} | |
| api-user-github: ${{ secrets.API_USER_GITHUB }} | |
| api-user-nuget: ${{ secrets.API_USER_NUGET }} | |
| - name: Setup .NET Core SDK | |
| uses: actions/[email protected] | |
| with: | |
| dotnet-version: ${{ env.DOTNET_VERSION }} | |
| - uses: actions/[email protected] | |
| with: | |
| pattern: packages-* | |
| path: nuget | |
| - name: Remove old formats | |
| run: | | |
| rm -rf ${{ github.workspace }}/tests/gdal-formats | |
| - uses: actions/[email protected] | |
| with: | |
| pattern: formats-* | |
| path: "tests/gdal-formats" | |
| - name: Build bundle | |
| run: | | |
| make -f generate-projects-makefile generate-final-bundle BUILD_NUMBER_TAIL=${{ github.run_number }} | |
| make -f publish-makefile pack-bundle-final PRERELEASE=${{ env.IS_PRE_RELEASE }} BUILD_NUMBER_TAIL=${{ github.run_number }} | |
| echo "GDAL_VERSION=$(make -f publish-makefile get-gdal-version)" >> $GITHUB_ENV | |
| echo "PACKAGES_VERSION=$(make -f publish-makefile get-package-version BUILD_NUMBER_TAIL=${{ github.run_number }})" >> $GITHUB_ENV | |
| - name: Run tests from nuget packages | |
| env: | |
| TEST_PROJECT: ${{ github.workspace }}/tests/MaxRev.Gdal.Core.Tests.XUnit/MaxRev.Gdal.Core.Tests.XUnit.csproj | |
| run: | | |
| dotnet add ${{ env.TEST_PROJECT }} package MaxRev.Gdal.Universal --source local.ci --no-restore | |
| dotnet remove ${{ env.TEST_PROJECT }} package MaxRev.Gdal.Core || echo "no packages to remove" | |
| dotnet restore --ignore-failed-sources ${{ env.TEST_PROJECT }} | |
| dotnet test --no-restore ${{ env.TEST_PROJECT }} | |
| - name: Store packages as artifact | |
| uses: actions/[email protected] | |
| with: | |
| name: packages-final | |
| path: nuget/*.nupkg | |
| overwrite: true | |
| - name: Process gdal formats | |
| working-directory: shared/scripts | |
| run: | | |
| python -m venv venv && source venv/bin/activate | |
| pip install -r requirements.txt | |
| python ./combine-formats.py '${{ github.workspace }}/tests/gdal-formats' | |
| - name: Commit changes | |
| if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| uses: EndBug/add-and-commit@v9 | |
| with: | |
| author_name: ${{ secrets.COMMIT_AUTHOR }} | |
| author_email: ${{ secrets.COMMIT_EMAIL }} | |
| message: "List of drivers in current version [ci skip]" | |
| add: "${{ github.workspace }}/tests/gdal-formats/**" | |
| tag: "v${{ env.PACKAGES_VERSION }} --force" | |
| - name: Push packages | |
| if: ${{ github.event.pull_request.merged == true || github.ref == 'refs/heads/main' || fromJson(needs.env-context.outputs.is-version-branch) }} | |
| run: | | |
| make -f push-packages-makefile PRERELEASE=${{ env.IS_PRE_RELEASE }} INCLUDE_CORE=1 \ | |
| BUILD_NUMBER_TAIL=${{ github.run_number }} API_KEY_GITHUB=${{ secrets.API_KEY_GITHUB }} API_KEY_NUGET=${{ secrets.API_KEY_NUGET }} |