Release hotfix #281
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
| # v3.800.35 | |
| # https://virtocommerce.atlassian.net/browse/VCST-5063 | |
| name: Release hotfix | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| incrementPatch: | |
| description: 'Increment patch version.' | |
| required: true | |
| default: true | |
| type: boolean | |
| jobs: | |
| test: | |
| uses: VirtoCommerce/.github/.github/workflows/test-and-sonar.yml@v3.800.42 | |
| secrets: | |
| sonarToken: ${{ secrets.SONAR_TOKEN }} | |
| build: | |
| uses: VirtoCommerce/.github/.github/workflows/build.yml@v3.800.42 | |
| with: | |
| uploadPackage: 'true' | |
| uploadDocker: 'true' | |
| imageName: 'platform' | |
| forceVersionSuffix: 'false' | |
| incrementPatch: ${{ github.event.inputs.incrementPatch }} | |
| secrets: | |
| envPAT: ${{ secrets.REPO_TOKEN }} | |
| get-metadata: | |
| runs-on: ubuntu-24.04 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} | |
| outputs: | |
| changelog: ${{ steps.changelog.outputs.changelog }} | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get Changelog | |
| id: changelog | |
| uses: VirtoCommerce/vc-github-actions/changelog-generator@master | |
| publish-docker: | |
| needs: | |
| [build, get-metadata] | |
| uses: VirtoCommerce/.github/.github/workflows/publish-docker.yml@v3.800.42 | |
| with: | |
| fullKey: ${{ needs.build.outputs.dockerFullKey }} | |
| shortKey: '${{ needs.build.outputs.dockerShortKey }}-' | |
| dockerTar: 'image.tar' | |
| publishToDocker: 'true' | |
| secrets: | |
| envPAT: ${{ secrets.GITHUB_TOKEN }} | |
| dockerUser: ${{ secrets.DOCKER_USERNAME }} | |
| dockerToken: ${{ secrets.DOCKER_TOKEN }} | |
| # Trusted Publishing: mint the OIDC key and push in ONE job (see publish-nugets.yml for why the | |
| # push can't live in the cross-repo publish-github.yml). job_workflow_ref = platform-release-hotfix.yml. | |
| publish-nuget: | |
| needs: [build, test] | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| id-token: write | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} | |
| steps: | |
| - name: Install VirtoCommerce.GlobalTool | |
| uses: VirtoCommerce/vc-github-actions/setup-vcbuild@master | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Get package from cache | |
| id: restore-build | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| key: ${{ needs.build.outputs.packageFullKey }} | |
| path: | | |
| ${{ github.workspace }}/artifacts | |
| ${{ github.workspace }}/publish | |
| - name: Exit if cache not restored | |
| if: steps.restore-build.outputs.cache-hit != 'true' | |
| env: | |
| FULL_KEY: ${{ needs.build.outputs.packageFullKey }} | |
| run: | | |
| echo "::error::Package cache not found for key ${FULL_KEY}" | |
| exit 1 | |
| - name: NuGet login (OIDC -> temp API key) | |
| id: nuget_login | |
| uses: NuGet/login@8d196754b4036150537f80ac539e15c2f1028841 # v1.2.0 | |
| with: | |
| # nuget.org user that created the trust policy (shared service account) | |
| user: virto | |
| - name: Publish Nuget | |
| uses: VirtoCommerce/vc-github-actions/publish-nuget@master | |
| with: | |
| skipString: 'Clean+Restore+Compile+Test+Pack' | |
| env: | |
| NUGET_KEY: ${{ steps.nuget_login.outputs.NUGET_API_KEY }} | |
| # forceNuget:false - the push is done by publish-nuget above; this only cuts the GitHub release. | |
| publish-github-release: | |
| needs: | |
| [build, test, get-metadata, publish-nuget] | |
| uses: VirtoCommerce/.github/.github/workflows/publish-github.yml@v3.800.42 | |
| with: | |
| fullKey: ${{ needs.build.outputs.packageFullKey }} | |
| changeLog: '${{ needs.get-metadata.outputs.changeLog }}' | |
| incrementPatch: ${{ github.event.inputs.incrementPatch }} | |
| makeLatest: 'false' | |
| forceNuget: false | |
| secrets: | |
| envPAT: ${{ secrets.GITHUB_TOKEN }} | |
| increment-version: | |
| needs: | |
| [publish-nuget, publish-github-release, publish-docker, test] | |
| if: ${{ github.event.inputs.incrementPatch == 'true' }} | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Install VirtoCommerce.GlobalTool | |
| uses: VirtoCommerce/vc-github-actions/setup-vcbuild@master | |
| - name: Setup Git Credentials | |
| uses: VirtoCommerce/vc-github-actions/setup-git-credentials-github@master | |
| with: | |
| githubToken: ${{ secrets.REPO_TOKEN }} | |
| - name: Increment Version | |
| run: | | |
| vc-build IncrementPatch | |
| git add ${{ github.workspace }}/Directory.Build.props | |
| git commit -m "ci: Auto IncrementPatch" | |
| git push |