-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(nightly): Add build image based on upstream Selenium Nightly (#…
…2088) Signed-off-by: Viet Nguyen Duc <[email protected]>
- Loading branch information
Showing
3 changed files
with
137 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Nightly | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
NAMESPACE: | ||
description: 'Set image registry' | ||
required: true | ||
default: 'selenium' | ||
schedule: | ||
- cron: '0 1 * * *' | ||
|
||
jobs: | ||
deploy: | ||
name: Nightly build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
fetch-depth: 0 | ||
- name: Output Docker info | ||
run: docker info | ||
- name: Sets build date | ||
run: echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV | ||
- name: Sets prerelease to nightly | ||
run: | | ||
echo "PRERELEASE=true" >> $GITHUB_ENV | ||
echo "NAME=${NAMESPACE}" >> $GITHUB_ENV | ||
env: | ||
NAMESPACE: ${{ github.event.inputs.NAMESPACE }} | ||
- name: Build base image to get Grid version | ||
run: VERSION="local" BUILD_DATE=${BUILD_DATE} make base_nightly | ||
- name: Get Grid version | ||
# sed used to remove last comma of Selenium version output | ||
run: | | ||
echo "GRID_VERSION=$(docker run --rm ${{ env.NAME }}/base:local-${BUILD_DATE} java -jar /opt/selenium/selenium-server.jar hub --version | awk '{print $3}' | sed 's/\(.*\),/\1 /')" | awk '{$1=$1;print}' >> $GITHUB_ENV | ||
- name: Display Grid version and set Base version | ||
run: | | ||
echo ${GRID_VERSION} | ||
echo "BASE_VERSION=$(echo ${GRID_VERSION})" >> $GITHUB_ENV | ||
echo "BASE_RELEASE=nightly" >> $GITHUB_ENV | ||
- name: Remove local Docker tag | ||
run: docker rmi ${{ env.NAME }}/base:local-${BUILD_DATE} | ||
- name: Build images | ||
run: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make build | ||
- name: Login Docker Hub | ||
run: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" | ||
env: | ||
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}} | ||
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}} | ||
- name: Tag images as nightly | ||
uses: nick-invision/retry@master | ||
with: | ||
timeout_minutes: 20 | ||
max_attempts: 3 | ||
command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make tag_nightly | ||
- name: Deploy nightly tag | ||
uses: nick-invision/retry@master | ||
with: | ||
timeout_minutes: 20 | ||
max_attempts: 3 | ||
command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make release_nightly | ||
- name: Sets env var for the next tag | ||
run: echo "NEXT_TAG=nightly" >> $GITHUB_ENV | ||
- name: Get current latest tag | ||
run: echo "LATEST_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV | ||
- name: Display latest tag | ||
run: echo ${LATEST_TAG} | ||
- name: Create release notes (release_notes.md) | ||
run: ./generate_release_notes.sh ${LATEST_TAG} origin/trunk ${GRID_VERSION} ${BUILD_DATE} | ||
- name: Create Nightly Release | ||
id: create_release | ||
uses: ncipollo/release-action@main | ||
with: | ||
#artifacts: | ||
replacesArtifacts: true | ||
bodyFile: "release_notes.md" | ||
generateReleaseNotes: true | ||
name: Nightly | ||
tag: nightly | ||
allowUpdates: true | ||
prerelease: ${{ env.PRERELEASE }} |
This file contains 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
This file contains 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