Skip to content

Commit 697e82d

Browse files
committed
Release automation for 4.0
1 parent bfd1542 commit 697e82d

File tree

72 files changed

+142
-1173
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+142
-1173
lines changed

.github/release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# .github/release.yml
2+
# Template for release notes (used by .github/workflows/release.yml)
3+
4+
changelog:
5+
exclude:
6+
labels:
7+
- ignore-for-release
8+
- dependencies
9+
authors:
10+
- dependabot
11+
categories:
12+
- title: Major Changes
13+
labels:
14+
- breaking-change
15+
- title: Additional Features
16+
labels:
17+
- enhancement
18+
- title: Bug Fixes
19+
labels:
20+
- "*"

.github/workflows/publish-latest-minor-gh-pages.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ jobs:
4545
cd $GITHUB_WORKSPACE/branch/documentation
4646
echo "Documentation branch is $GITHUB_REF_NAME..."
4747
echo "Building documentation for latest minor version..."
48+
git tag -l --sort=v:refname | grep v4.0 | tail -1 | cut -c2- > $GITHUB_WORKSPACE/branch/documentation/site/layouts/shortcodes/latestVersion.html
4849
hugo -s site -d "$GITHUB_WORKSPACE/WORK" -b https://oracle.github.io/weblogic-kubernetes-operator
4950
echo "Copying static files into place..."
50-
cp -R charts domains "$GITHUB_WORKSPACE/WORK"
51+
cp -R domains "$GITHUB_WORKSPACE/WORK"
5152
cd $GITHUB_WORKSPACE/gh-pages
5253
find . -maxdepth 1 -mindepth 1 -not -name '[0-9]*' -not -name '.git*' -exec rm -Rf {} \;
5354
cp -R $GITHUB_WORKSPACE/WORK/* .

.github/workflows/release.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
7+
env:
8+
REGISTRY: ghcr.io
9+
BASE_IMAGE_NAME: ghcr.io/oracle/weblogic-kubernetes-operator
10+
11+
jobs:
12+
build:
13+
name: Build
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: "Set environmental variables"
17+
run: |
18+
VERSION=${GITHUB_REF_NAME#v}
19+
echo "VERSION=$VERSION" >> $GITHUB_ENV
20+
echo "IMAGE_NAME=${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:$VERSION" >> $GITHUB_ENV
21+
22+
- name: Checkout branch
23+
uses: actions/checkout@v3
24+
25+
- name: Set up JDK
26+
uses: actions/setup-java@v3
27+
with:
28+
distribution: 'temurin'
29+
java-version: 17
30+
31+
- name: Cache Maven packages
32+
uses: actions/cache@v3
33+
with:
34+
path: ~/.m2
35+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
36+
restore-keys: ${{ runner.os }}-m2
37+
38+
- name: Build
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.PUBLISH_SECRET }}
41+
run: mvn clean package -Dtag=${{ env.VERSION }}
42+
43+
- name: Create Draft Release
44+
id: draft-release
45+
run: |
46+
echo 'PR_URL<<EOF' >> $GITHUB_ENV
47+
gh release create ${{ github.ref_name }} \
48+
--draft \
49+
--generate-notes \
50+
--target release/4.0 \
51+
--title 'Operator ${{ env.VERSION }}' \
52+
--repo https://github.com/oracle/weblogic-kubernetes-operator
53+
echo 'EOF' >> $GITHUB_ENV
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
57+
- name: Set up QEMU
58+
uses: docker/setup-qemu-action@v2
59+
60+
- name: Set up Buildx
61+
uses: docker/setup-buildx-action@v2
62+
63+
- name: Log in to the Container registry
64+
uses: docker/login-action@v2
65+
with:
66+
registry: ${{ env.REGISTRY }}
67+
username: ${{ github.actor }}
68+
password: ${{ secrets.GITHUB_TOKEN }}
69+
70+
- name: Build and push container image
71+
uses: docker/build-push-action@v4
72+
with:
73+
context: .
74+
platforms: linux/amd64,linux/arm64
75+
push: true
76+
tags: ${{ env.IMAGE_NAME }}
77+
78+
- name: Checkout gh-pages
79+
uses: actions/checkout@v3
80+
with:
81+
ref: gh-pages
82+
path: gh-pages
83+
token: ${{ secrets.PUBLISH_SECRET }}
84+
85+
- name: Generate and publish Helm chart
86+
run: |
87+
curl -fL -o helm.tar.gz "https://get.helm.sh/helm-v3.12.1-linux-amd64.tar.gz"
88+
tar -xf helm.tar.gz
89+
export PATH="$PWD/linux-amd64:$PATH"
90+
sed -i 's#4.0.0-RELEASE-MARKER#${{ env.BASE_IMAGE_NAME }}:$VERSION#g' $GITHUB_WORKSPACE/kubernetes/charts/weblogic-operator/values.yaml
91+
mkdir $GITHUB_WORKSPACE/WORK
92+
helm package --app-version $VERSION --version $VERSION $GITHUB_WORKSPACE/kubernetes/charts/weblogic-operator -d $GITHUB_WORKSPACE/WORK
93+
cp $GITHUB_WORKSPACE/WORK/*.tgz $GITHUB_WORKSPACE/gh-pages/charts/
94+
helm repo index $GITHUB_WORKSPACE/gh-pages/charts/ --url https://oracle.github.io/weblogic-kubernetes-operator/charts
95+
cd $GITHUB_WORKSPACE/gh-pages
96+
git config --global user.name "github-actions[bot]"
97+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
98+
git add --all
99+
git commit -m "Helm chart update from release GitHub Action"
100+
git push origin gh-pages

Dockerfile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Copyright (c) 2017, 2023, Oracle and/or its affiliates.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33
#
4-
# HOW TO BUILD AND PUSH THIS IMAGE
5-
# -----------------------
6-
# Run:
7-
# $ ./buildAndPushImage.sh -t <image-name>
8-
#
94
# -------------------------
105
FROM ghcr.io/oracle/oraclelinux:9-slim AS jre-build
116

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ You can:
2424

2525
The fastest way to experience the operator is to follow the [Quick Start guide](https://oracle.github.io/weblogic-kubernetes-operator/quickstart/), or you can peruse our [documentation](https://oracle.github.io/weblogic-kubernetes-operator), read our [blogs](https://blogs.oracle.com/weblogicserver/how-to-weblogic-server-on-kubernetes), or try out the [samples](https://oracle.github.io/weblogic-kubernetes-operator/samples/).
2626

27-
***
28-
The [current release of the operator](https://github.com/oracle/weblogic-kubernetes-operator/releases) is 4.0.6.
29-
This release was published on April 8, 2023.
30-
***
31-
3227
## Documentation
3328

3429
Documentation for the operator is [available here](https://oracle.github.io/weblogic-kubernetes-operator).

buildAndPushImage.sh

Lines changed: 0 additions & 90 deletions
This file was deleted.

0 commit comments

Comments
 (0)