Skip to content

[maven-release-plugin] prepare release v4.1.3 #9

[maven-release-plugin] prepare release v4.1.3

[maven-release-plugin] prepare release v4.1.3 #9

Workflow file for this run

name: Release
on:
push:
tags:
- v*
env:
REGISTRY: ghcr.io
BASE_IMAGE_NAME: ghcr.io/oracle/weblogic-kubernetes-operator
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: "Set environmental variables"
run: |
VERSION=${GITHUB_REF_NAME#v}
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "IMAGE_NAME=${{ env.BASE_IMAGE_NAME }}:$VERSION" >> $GITHUB_ENV
- name: Checkout branch
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.PUBLISH_SECRET }}
run: mvn clean package -Dtag=${{ env.VERSION }}
- name: Create Draft Release
id: draft-release
run: |
echo 'PR_URL<<EOF' >> $GITHUB_ENV
gh release create ${{ github.ref_name }} \
--draft \
--generate-notes \
--target release/4.1 \
--title 'Operator ${{ env.VERSION }}' \
--repo https://github.com/oracle/weblogic-kubernetes-operator \
domain-upgrader/target/domain-upgrader.jar
echo 'EOF' >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.PUBLISH_SECRET }}
- name: Build and push container image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.IMAGE_NAME }}
- name: Checkout gh-pages
uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages
token: ${{ secrets.PUBLISH_SECRET }}
- name: Generate and publish Helm chart
run: |
curl -fL -o helm.tar.gz "https://get.helm.sh/helm-v3.12.1-linux-amd64.tar.gz"
tar -xf helm.tar.gz
export PATH="$PWD/linux-amd64:$PATH"
sed -i 's#4.1.0-RELEASE-MARKER#${{ env.BASE_IMAGE_NAME }}:${{ env.VERSION }}#g' $GITHUB_WORKSPACE/kubernetes/charts/weblogic-operator/values.yaml
mkdir $GITHUB_WORKSPACE/WORK
helm package --app-version $VERSION --version $VERSION $GITHUB_WORKSPACE/kubernetes/charts/weblogic-operator -d $GITHUB_WORKSPACE/WORK
cp $GITHUB_WORKSPACE/WORK/*.tgz $GITHUB_WORKSPACE/gh-pages/charts/
helm repo index $GITHUB_WORKSPACE/gh-pages/charts/ --url https://oracle.github.io/weblogic-kubernetes-operator/charts
cd $GITHUB_WORKSPACE/gh-pages
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add --all
git commit -m "Helm chart update from release GitHub Action"
git push origin gh-pages