Release 0.2.1 #49
Workflow file for this run
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
name: Release | |
on: | |
pull_request: | |
types: [closed] | |
paths: | |
- '.github/project.yml' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
name: release | |
if: ${{github.event.pull_request.merged == true}} | |
env: | |
GITHUB_TOKEN: ${{secrets.RELEASE_TOKEN}} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{secrets.RELEASE_TOKEN}} | |
- name: Retrieve Project Metadata | |
uses: radcortez/project-metadata-action@603060a0627d4f04d37d20331ebd472377fd088b | |
id: metadata | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
metadata-file-path: '.github/project.yml' | |
- name: Setup JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and Push API and Operator Image | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git checkout -b release | |
mvn -B release:prepare -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}} | |
git checkout ${{github.base_ref}} | |
git rebase release | |
export QUARKUS_CONTAINER_IMAGE_REGISTRY="${{ secrets.IMAGE_REPO_HOSTNAME }}" | |
export QUARKUS_CONTAINER_IMAGE_GROUP="${{ secrets.IMAGE_REPO_NAMESPACE }}" | |
export QUARKUS_CONTAINER_IMAGE_USERNAME="${{ secrets.IMAGE_REPO_USERNAME }}" | |
export QUARKUS_CONTAINER_IMAGE_PASSWORD="${{ secrets.IMAGE_REPO_PASSWORD }}" | |
export QUARKUS_CONTAINER_IMAGE_PUSH="true" | |
export QUARKUS_CONTAINER_IMAGE_ADDITIONAL_TAGS=latest | |
export GIT_REVISION=$(git rev-parse --short release) | |
# Build and push the release images using the commit tagged in `release:prepare` | |
mvn -B -P container-image release:perform --no-transfer-progress '-Drelease.arguments=-Dquarkus.docker.buildx.platform=linux/amd64,linux/arm64' | |
- name: Login to Quay | |
uses: docker/login-action@v3 | |
with: | |
registry: "${{ secrets.IMAGE_REPO_HOSTNAME }}" | |
username: "${{ secrets.IMAGE_REPO_USERNAME }}" | |
password: "${{ secrets.IMAGE_REPO_PASSWORD }}" | |
- name: Modify CSV Annotation | |
run: ./operator/bin/modify-bundle-metadata.sh | |
- name: Build and Push Operator Bundle Image | |
uses: docker/build-push-action@v6 | |
with: | |
context: target/checkout/operator/target/bundle/console-operator/ | |
platforms: linux/amd64,linux/arm64 | |
provenance: false | |
push: true | |
file: target/checkout/operator/target/bundle/console-operator/bundle.Dockerfile | |
tags: | | |
${{ secrets.IMAGE_REPO_HOSTNAME }}/${{ secrets.IMAGE_REPO_NAMESPACE }}/console-operator-bundle:${{steps.metadata.outputs.current-version}} | |
${{ secrets.IMAGE_REPO_HOSTNAME }}/${{ secrets.IMAGE_REPO_NAMESPACE }}/console-operator-bundle:latest | |
- name: Build Operator Catalog | |
working-directory: target/checkout | |
run: | | |
curl -L -o opm https://github.com/operator-framework/operator-registry/releases/download/v1.43.1/linux-amd64-opm | |
chmod +x opm | |
sudo cp -v opm /usr/bin/ | |
rm -vf opm | |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | tr '[:upper:]' '[:lower:]') | |
operator/bin/generate-catalog.sh ${VERSION} | |
- name: Build and Push Operator Catalog Image | |
uses: docker/build-push-action@v6 | |
with: | |
context: target/checkout/operator/target/ | |
platforms: linux/amd64,linux/arm64 | |
provenance: false | |
push: true | |
file: target/checkout/operator/target/catalog.Dockerfile | |
tags: | | |
${{ secrets.IMAGE_REPO_HOSTNAME }}/${{ secrets.IMAGE_REPO_NAMESPACE }}/console-operator-catalog:${{steps.metadata.outputs.current-version}} | |
${{ secrets.IMAGE_REPO_HOSTNAME }}/${{ secrets.IMAGE_REPO_NAMESPACE }}/console-operator-catalog:latest | |
- name: Build UI | |
working-directory: target/checkout/ui | |
run: | | |
npm ci --omit=dev | |
export BACKEND_URL=http://example | |
export CONSOLE_METRICS_PROMETHEUS_URL=http://example | |
export NEXTAUTH_SECRET=examplesecret | |
export LOG_LEVEL=info | |
export CONSOLE_MODE=read-only | |
npm run build | |
- name: Build and Push UI Image | |
uses: docker/build-push-action@v6 | |
with: | |
context: target/checkout/ui/ | |
platforms: linux/amd64,linux/arm64 | |
provenance: false | |
push: true | |
tags: | | |
${{ secrets.IMAGE_REPO_HOSTNAME }}/${{ secrets.IMAGE_REPO_NAMESPACE }}/console-ui:${{steps.metadata.outputs.current-version}} | |
${{ secrets.IMAGE_REPO_HOSTNAME }}/${{ secrets.IMAGE_REPO_NAMESPACE }}/console-ui:latest | |
- name: Push Release Tag | |
run: | | |
git push | |
git push --tags | |
- name: Create GitHub Release | |
uses: radcortez/milestone-release-action@89b8ddd2e11a5dad6f9b66bea5435724b00de0f6 | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
milestone-title: ${{steps.metadata.outputs.current-version}} | |
milestone-next: ${{steps.metadata.outputs.next-version}} | |
- name: Image Update | |
uses: renovatebot/[email protected] | |
with: | |
configurationFile: .github/gitops-config.json | |
token: ${{ secrets.RELEASE_TOKEN }} |