Merge pull request #6 from openstandia/dev #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release package to the Maven Central Repository | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build and release | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, '[ci skip]')" | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
# Disabling shallow clone is needed for correctly determing next release with semantic release | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'corretto' | |
java-version: 11 | |
cache: 'maven' | |
server-id: ossrh | |
server-username: OSSRH_JIRA_USERNAME | |
server-password: OSSRH_JIRA_PASSWORD | |
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} | |
gpg-passphrase: OSSRH_GPG_SECRET_KEY_PASSWORD | |
- name: Test | |
run: mvn -B test | |
- name: Semantic release | |
id: semantic | |
uses: cycjimmy/semantic-release-action@v4 | |
with: | |
semantic_version: 23 | |
extra_plugins: | | |
@semantic-release/changelog@6 | |
@terrestris/maven-semantic-release@2 | |
@semantic-release/git@10 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
OSSRH_JIRA_USERNAME: ${{ secrets.OSSRH_JIRA_USERNAME }} | |
OSSRH_JIRA_PASSWORD: ${{ secrets.OSSRH_JIRA_PASSWORD }} | |
OSSRH_GPG_SECRET_KEY_PASSWORD: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} |