Skip to content

Commit a4a11f1

Browse files
committed
Configure Release Workflow
1 parent ea2f4de commit a4a11f1

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

.github/workflows/release.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Release
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
release:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
java: ['8']
11+
env:
12+
GIT_USER_NAME: puneetbehl
13+
GIT_USER_EMAIL: behlp@objectcomputing.com
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
with:
18+
token: ${{ secrets.GH_TOKEN }}
19+
- uses: gradle/wrapper-validation-action@v1
20+
- name: Set up JDK
21+
uses: actions/setup-java@v3
22+
with:
23+
distribution: 'adopt'
24+
java-version: ${{ matrix.java }}
25+
- name: Set the current release version
26+
id: release_version
27+
run: echo ::set-output name=release_version::${GITHUB_REF:11}
28+
- name: Run pre-release
29+
uses: micronaut-projects/github-actions/pre-release@master
30+
with:
31+
token: ${{ secrets.GITHUB_TOKEN }}
32+
- name: Generate secring file
33+
env:
34+
SECRING_FILE: ${{ secrets.SECRING_FILE }}
35+
run: echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg
36+
- name: Publish to Sonatype OSSRH
37+
id: publish
38+
uses: gradle/gradle-build-action@v2
39+
env:
40+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
41+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
42+
SONATYPE_NEXUS_URL: ${{ secrets.SONATYPE_NEXUS_URL }}
43+
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
44+
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
45+
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
46+
SECRING_FILE: ${{ secrets.SECRING_FILE }}
47+
with:
48+
arguments: -Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg publishToSonatype closeAndReleaseSonatypeStagingRepository
49+
- name: Publish Documentation
50+
id: docs
51+
if: steps.publish.outcome == 'success'
52+
uses: gradle/gradle-build-action@v2
53+
with:
54+
arguments: docs
55+
- name: Export Gradle Properties
56+
uses: micronaut-projects/github-actions/export-gradle-properties@master
57+
- name: Publish to Github Pages
58+
if: steps.docs.outcome == 'success'
59+
uses: micronaut-projects/github-pages-deploy-action@master
60+
env:
61+
BETA: ${{ contains(steps.release_version.outputs.release_version, 'M') || contains(steps.release_version.outputs.release_version, 'RC') }}
62+
TARGET_REPOSITORY: ${{ github.repository }}
63+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
64+
BRANCH: gh-pages
65+
FOLDER: build/docs
66+
DOC_FOLDER: gh-pages
67+
COMMIT_EMAIL: behlp@objectcomputing.com
68+
COMMIT_NAME: Puneet Behl
69+
VERSION: ${{ steps.release_version.outputs.release_version }}
70+
- name: Run post-release
71+
if: success()
72+
uses: micronaut-projects/github-actions/post-release@master
73+
with:
74+
token: ${{ secrets.GITHUB_TOKEN }}
75+
env:
76+
SNAPSHOT_SUFFIX: -SNAPSHOT

0 commit comments

Comments
 (0)