Skip to content

Commit 11a7170

Browse files
committed
Merge branch 'gh-release-action' into 'main'
moved release creation to GitHub workflow See merge request weblogic-cloud/weblogic-image-tool!449
2 parents 4fd86a0 + 3999c40 commit 11a7170

File tree

2 files changed

+26
-27
lines changed

2 files changed

+26
-27
lines changed

.github/workflows/create-release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Create Release
2+
run-name: Creating draft release for ${{ github.ref_name }}
3+
4+
on:
5+
push:
6+
tags:
7+
- 'release-*'
8+
9+
jobs:
10+
release_job:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- run: |
15+
mvn -B clean package
16+
- id: version
17+
run: echo "::set-output name=number::`echo "${{ github.ref_name }}" | sed 's/release-//'`"
18+
- env:
19+
GH_TOKEN: ${{ github.token }}
20+
run: |
21+
gh release create ${{ github.ref_name }} \
22+
--draft \
23+
--generate-notes \
24+
--title 'WebLogic Image Tool ${{ steps.version.outputs.number }}' \
25+
installer/target/imagetool.zip

Jenkinsfile

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -162,40 +162,14 @@ pipeline {
162162
stage ('Sync') {
163163
when {
164164
branch 'main'
165-
anyOf {
166-
not { triggeredBy 'TimerTrigger' }
167-
tag 'release-*'
168-
}
165+
not { triggeredBy 'TimerTrigger' }
169166
}
170167
steps {
171168
build job: "wkt-sync",
172169
parameters: [ string(name: 'REPOSITORY', value: 'weblogic-image-tool') ],
173170
wait: true
174171
}
175172
}
176-
stage ('Create Draft Release') {
177-
when {
178-
tag 'release-*'
179-
}
180-
steps {
181-
script {
182-
env.TAG_VERSION_NUMBER = env.TAG_NAME.replaceAll('release-','').trim()
183-
}
184-
withCredentials([string(credentialsId: 'wkt-github-token', variable: 'GITHUB_API_TOKEN')]) {
185-
sh """
186-
mkdir gh-cli
187-
curl -sL https://github.com/cli/cli/releases/download/v2.28.0/gh_2.28.0_linux_amd64.tar.gz | tar xvzf - --strip-components=1 -C ./gh-cli
188-
echo '${GITHUB_API_TOKEN}' | ./gh-cli/bin/gh auth login --with-token
189-
./gh-cli/bin/gh release create ${TAG_NAME} \
190-
--draft \
191-
--generate-notes \
192-
--title 'WebLogic Image Tool ${TAG_VERSION_NUMBER}' \
193-
--repo https://github.com/oracle/weblogic-image-tool \
194-
installer/target/imagetool.zip
195-
"""
196-
}
197-
}
198-
}
199173
}
200174
}
201175

0 commit comments

Comments
 (0)