Release #316
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: Release | |
| on: | |
| schedule: | |
| - cron: "0 0 * * *" | |
| push: | |
| branches: | |
| - "main" | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }} | |
| cancel-in-progress: false | |
| jobs: | |
| GetLatestVersions: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| CHROME_VERSION: ${{ steps.versions.outputs.CHROME_VERSION }} | |
| NUGET_PACKAGE_VERSION: ${{ steps.versions.outputs.NUGET_PACKAGE_VERSION }} | |
| steps: | |
| - uses: actions/checkout@v4.2.2 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '9.x' | |
| - name: Run Version Manager | |
| id: versions | |
| run: dotnet run -c Release --project ChromeForTesting/ChromeForTesting.VersionManager | |
| env: | |
| VERSION_INCREMENT: '33' | |
| VerifyTagExists: | |
| needs: | |
| - GetLatestVersions | |
| runs-on: ubuntu-latest | |
| outputs: | |
| exists: ${{ steps.checkReleaseExists.outputs.exists }} | |
| env: | |
| NUGET_PACKAGE_VERSION: ${{ needs.GetLatestVersions.outputs.NUGET_PACKAGE_VERSION }} | |
| steps: | |
| - uses: mukunku/tag-exists-action@v1.6.0 | |
| id: checkReleaseExists | |
| with: | |
| tag: v${{ env.NUGET_PACKAGE_VERSION }} | |
| Archive-Linux64: | |
| needs: | |
| - GetLatestVersions | |
| - VerifyTagExists | |
| if: ${{ needs.VerifyTagExists.outputs.exists == 'false' }} | |
| runs-on: ubuntu-latest | |
| env: | |
| CHROME_VERSION: ${{ needs.GetLatestVersions.outputs.CHROME_VERSION }} | |
| steps: | |
| - uses: actions/checkout@v4.2.2 | |
| - name: Build archive | |
| run: | | |
| set -e | |
| docker build . -f Dockerfile.BuildLinux64 -t chrome-linux64:latest --platform linux/amd64 --build-arg CHROME_VERSION=${{ env.CHROME_VERSION }} | |
| docker create --name chrome-linux64 --platform linux/amd64 chrome-linux64:latest | |
| docker cp chrome-linux64:/chrome-linux64.tar.gz chrome-linux64.tar.gz | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: chrome-linux64 | |
| path: chrome-linux64.tar.gz | |
| Release: | |
| needs: | |
| - GetLatestVersions | |
| - Archive-Linux64 | |
| runs-on: ubuntu-latest | |
| env: | |
| CHROME_VERSION: ${{ needs.GetLatestVersions.outputs.CHROME_VERSION }} | |
| NUGET_PACKAGE_VERSION: ${{ needs.GetLatestVersions.outputs.NUGET_PACKAGE_VERSION }} | |
| steps: | |
| - uses: actions/checkout@v4.2.2 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: chrome-linux64 | |
| path: chrome-linux64 | |
| - run: | | |
| set -e | |
| gh release create v${{ env.NUGET_PACKAGE_VERSION }} --title "Chrome v${{ env.NUGET_PACKAGE_VERSION }}" \ | |
| chrome-linux64/chrome-linux64.tar.gz | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Replace Version | |
| run: | | |
| set -e | |
| sed 's/$(ChromeVersion)/${{ env.CHROME_VERSION }}/g' -i ChromeForTesting/ChromeForTesting/buildTransitive/ChromeForTesting.props | |
| sed 's/$(Version)/${{ env.NUGET_PACKAGE_VERSION }}/g' -i ChromeForTesting/ChromeForTesting/buildTransitive/ChromeForTesting.props | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 9.x | |
| - name: Pack | |
| working-directory: ChromeForTesting | |
| run: dotnet pack ChromeForTesting --configuration Release /p:Version=${{ env.NUGET_PACKAGE_VERSION }} /p:ChromeVersion=${{ env.CHROME_VERSION }} | |
| - name: Publish nuget | |
| working-directory: ChromeForTesting | |
| run: dotnet nuget push ChromeForTesting/bin/Release/ChromeForTesting.*.nupkg -k ${{secrets.NUGET_API_KEY}} -s https://www.nuget.org --skip-duplicate |