Skip to content

Release

Release #744

Workflow file for this run

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@v6.0.1
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '9.x'
- name: Run Version Manager
id: versions
run: dotnet run -c Release --project ChromeForTesting/ChromeForTesting.VersionManager
env:
VERSION_INCREMENT: '45'
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.7.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@v6.0.1
- 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@v6
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@v6.0.1
- uses: actions/download-artifact@v7
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@v5
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