Skip to content

Commit f1e2be3

Browse files
committed
Synchronize release automation changes
1 parent 0ca11c0 commit f1e2be3

File tree

17 files changed

+137
-629
lines changed

17 files changed

+137
-629
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/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.1 \
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.1.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.

documentation/site/content/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ using the operator to deploy and run a WebLogic domain container-packaged web ap
3232
#### Current production release
3333

3434
The [current release of the operator](https://github.com/oracle/weblogic-kubernetes-operator/releases) is {{< latestVersion >}}.
35-
This release was published on April 8, 2023. See the [operator prerequisites]({{< relref "/introduction/prerequisites/introduction.md" >}}) and [supported environments]({{< relref "/introduction/platforms/environments.md" >}}).
35+
See the [operator prerequisites]({{< relref "/introduction/prerequisites/introduction.md" >}}) and [supported environments]({{< relref "/introduction/platforms/environments.md" >}}).
3636

3737
***
3838

documentation/site/content/developerguide/building.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Contributions must conform to [coding and formatting standards]({{< relref "/dev
2323
These commands should be executed in the project root directory:
2424

2525
```shell
26-
$ ./buildAndPushImage.sh -t weblogic-kubernetes-operator:some-tag
26+
$ docker build -t weblogic-kubernetes-operator:some-tag .
2727
```
2828

2929
Replace `<version>` with the version of the project found in the `pom.xml` file in the project root directory.

0 commit comments

Comments
 (0)