-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates for release/publish workflow
- Loading branch information
1 parent
7694a3c
commit 1591ee9
Showing
10 changed files
with
204 additions
and
195 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: "Setup Node and Docker build environment" | ||
description: "Reusable action to set up the environment for builds and tests" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 9.6.0 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: 'pnpm' | ||
|
||
- name: Install Javascript dependencies (PNPM) | ||
run: pnpm install | ||
|
||
- name: Setup QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Setup a Docker Buildx builder | ||
id: builder | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
platforms: linux/amd64,linux/arm64 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: 📦 Build and Publish a WBS Image Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
image_name: | ||
description: 'Image to release' | ||
type: choice | ||
required: true | ||
default: 'wikibase' | ||
options: | ||
- elasticsearch | ||
- quickstatements | ||
- wdqs | ||
- wdqs-frontend | ||
- wdqs-proxy | ||
- wikibase | ||
- All images with unreleased changes | ||
dry_run: | ||
description: "Only log what will be done, don't do it yet." | ||
type: boolean | ||
required: true | ||
default: true | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: ./.github/actions/setup-environment | ||
|
||
- uses: docker/login-action@v3 | ||
with: | ||
# implicitly docker hub | ||
username: wmdetravisbot | ||
password: ${{ secrets.WBS_PUBLISH_TOKEN }} | ||
|
||
- name: Git tag release and publish version tagged images to Dockerhub | ||
run: | | ||
set -e # abort on error | ||
set -x # show commands | ||
git config --global user.name 'wikibase suite github actions bot' | ||
git config --global user.email 'wikibase-suite-github-actions-bot@users.noreply.github.com' | ||
if [ "${{ inputs.dry_run }}" == "true" ]; then | ||
DRY_RUN_FLAG="--dry-run" | ||
else | ||
DRY_RUN_FLAG="" | ||
fi | ||
if [ "${{ inputs.image_name }}" == "All images with unreleased changes" ]; then | ||
PROJECT_ARG="" | ||
else | ||
PROJECT_ARG="-p ${{ inputs.image_name }}" | ||
fi | ||
pnpm exec nx release publish $PROJECT_ARG $DRY_RUN_FLAG |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.