Nightly #1297
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: Nightly | |
| on: | |
| schedule: | |
| - cron: 0 0 * * * | |
| workflow_dispatch: | |
| inputs: | |
| language: | |
| description: Language artefacts | |
| required: true | |
| type: choice | |
| default: "all" | |
| options: | |
| - all | |
| - java | |
| - ruby | |
| - python | |
| - dotnet | |
| - javascript | |
| workflow_call: | |
| inputs: | |
| language: | |
| required: false | |
| type: string | |
| default: "all" | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| prepare: | |
| name: Prepare | |
| runs-on: ubuntu-latest | |
| if: github.event.repository.fork == false | |
| outputs: | |
| language: ${{ steps.parse.outputs.language }} | |
| artifact-name: ${{ steps.parse.outputs.artifact-name }} | |
| artifact-path: ${{ steps.parse.outputs.artifact-path }} | |
| release-in-progress: ${{ steps.check.outputs.release-in-progress }} | |
| steps: | |
| - name: Parse inputs | |
| id: parse | |
| env: | |
| LANGUAGE: ${{ inputs.language }} | |
| run: | | |
| LANG="${LANGUAGE:-all}" | |
| echo "language=$LANG" >> "$GITHUB_OUTPUT" | |
| if [[ "$LANG" == "all" || "$LANG" == "java" ]]; then | |
| echo "artifact-name=nightly-grid" >> "$GITHUB_OUTPUT" | |
| echo "artifact-path=build/dist/*.*" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Check if release ruleset is active | |
| id: check | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| set -euo pipefail | |
| if ! ENFORCEMENT=$(gh api /repos/${{ github.repository }}/rulesets/11911909 --jq '.enforcement' 2>/dev/null); then | |
| echo "::warning::Failed to check release ruleset, assuming release in progress" | |
| echo "release-in-progress=true" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| echo "release-in-progress=$([[ "$ENFORCEMENT" == "active" ]] && echo 'true' || echo 'false')" >> "$GITHUB_OUTPUT" | |
| nightly-release: | |
| name: Nightly ${{ needs.prepare.outputs.language }} | |
| needs: prepare | |
| if: needs.prepare.outputs.release-in-progress != 'true' | |
| uses: ./.github/workflows/bazel.yml | |
| with: | |
| name: Nightly ${{ needs.prepare.outputs.language }} Release | |
| run: ./go ${{ needs.prepare.outputs.language }}:release nightly | |
| artifact-name: ${{ needs.prepare.outputs.artifact-name }} | |
| artifact-path: ${{ needs.prepare.outputs.artifact-path }} | |
| secrets: inherit | |
| release-grid: | |
| name: Release Grid | |
| needs: [prepare, nightly-release] | |
| if: needs.prepare.outputs.artifact-name | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download grid packages | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: nightly-grid | |
| path: build/dist | |
| - name: Create nightly release | |
| uses: marvinpinto/[email protected] | |
| with: | |
| repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
| automatic_release_tag: nightly | |
| title: Nightly | |
| prerelease: true | |
| files: build/dist/*.* | |
| on-failure: | |
| name: Notify on Failure | |
| runs-on: ubuntu-latest | |
| needs: [prepare, nightly-release, release-grid] | |
| if: failure() | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Slack Notification | |
| uses: rtCamp/action-slack-notify@v2 | |
| env: | |
| SLACK_ICON_EMOJI: ":rotating_light:" | |
| SLACK_COLOR: failure | |
| SLACK_CHANNEL: selenium-tlc | |
| SLACK_USERNAME: GitHub Workflows | |
| SLACK_TITLE: Nightly ${{ needs.prepare.outputs.language }} Release failed | |
| MSG_MINIMAL: actions url | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} |