Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

feat: add release action #1

feat: add release action

feat: add release action #1

Workflow file for this run

name: Release
on:
pull_request:
branches:
- main
types:
- closed
# Cancel any active builds when new commits are pushed
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
parent:
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/')
runs-on: ubuntu-latest
environment: Production
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '20'
distribution: 'zulu'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Maven Package
run: cd parent && mvn clean package
- name: Bump Version
id: bump-version
uses: RichardInnocent/[email protected]
with:
access-token: ${{ secrets.github_token }}
version-prefix:
pom-path: ./parent
- name: Maven Publish
run: cd parent && mvn --batch-mode clean deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
common:
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/')
runs-on: ubuntu-latest
environment: Production
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '20'
distribution: 'zulu'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Maven Package
run: cd common && mvn clean package
- name: Bump Version
id: bump-version
uses: RichardInnocent/[email protected]
with:
access-token: ${{ secrets.github_token }}
version-prefix:
pom-path: common
- name: Maven Publish
run: cd common && mvn --batch-mode clean deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}