Skip to content

Release Staging

Release Staging #133

Workflow file for this run

name: Release Staging
on:
pull_request:
types: [ closed ]
workflow_dispatch:
inputs:
version:
description: 'Selenium version to release'
required: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
jobs:
github-release:
if: >
(github.event.pull_request.merged == true &&
github.repository_owner == 'seleniumhq' &&
startsWith(github.event.pull_request.head.ref, 'release-preparation-')) ||
(github.event_name == 'workflow_dispatch' &&
github.event.inputs.version != '' &&
github.repository_owner == 'seleniumhq')
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Extract version from branch name
if: github.event.pull_request.merged == true
run: |
VERSION=$(echo $BRANCH_NAME | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Extract version from workflow input
if: github.event_name == 'workflow_dispatch'
run: |
VERSION=${{ inputs.version }}
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Prep git
run: |
git config --local user.email "[email protected]"
git config --local user.name "Selenium CI Bot"
- name: Tag Release
run: |
git tag selenium-${{ env.VERSION }} || echo "Tag already exists"
git push origin selenium-${{ env.VERSION }} || echo "Tag already exists remotely"
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
- name: Setup curl for Ubuntu
run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev
- name: Build and Stage Packages
run: ./go all:package[--config=release]
- name: Update Nightly Tag to Remove pre-release
run: |
git fetch --tags
git tag -d nightly || echo "Nightly tag not found"
git tag nightly
git push origin refs/tags/nightly --force
- name: Generate Draft Release
uses: softprops/action-gh-release@v2
with:
name: Selenium ${{ env.VERSION }}
tag_name: selenium-${{ env.VERSION }}
draft: true
generate_release_notes: true
prerelease: false
files: build/dist/*.*
update-documentation:
needs: github-release
uses: ./.github/workflows/update-documentation.yml
with:
tag: selenium-${{ needs.github-release.outputs.version }}