Merge pull request #40 from csowada/develop #21
Workflow file for this run
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
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created | |
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path | |
name: Maven Package | |
on: | |
push: | |
# Sequence of patterns matched against refs/tags | |
tags: | |
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Cache for Maven packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Import GPG keys | |
run: 'echo -e "$GPG_FILE" | gpg2 --import --no-tty --batch --yes' | |
shell: bash | |
env: | |
GPG_FILE: ${{secrets.GPG_FILE}} | |
- name: Set up Java for Apache Maven Central | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 11 | |
distribution: temurin | |
cache: maven | |
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml | |
server-username: OSSRH_USERNAME # env variable for username in deploy | |
server-password: OSSRH_PASSWORD # env variable for token in deploy | |
gpg-passphrase: GPG_PASSPHRASE # env variable for GPG private key passphrase | |
- name: Build and Verify with Maven | |
run: mvn --batch-mode --update-snapshots clean compile verify | |
- name: Publish to Apache Maven Central | |
# run: mvn deploy --batch-mode --update-snapshots -P sign,!build-extras -Dmaven.test.skip=true | |
run: mvn deploy --batch-mode --update-snapshots -P sign,!build-extras,deploy-ossrh -Dmaven.test.skip=true | |
env: | |
OSSRH_USERNAME: ${{ secrets.OSSRH_JIRA_USERNAME }} | |
OSSRH_PASSWORD: ${{ secrets.OSSRH_JIRA_PASSWORD }} | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
- name: Set up Java for publishing to GitHub Packages | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 11 | |
distribution: temurin | |
cache: maven | |
- name: Publish to GitHub Packages | |
# -DaltDeploymentRepository=github::default::https://maven.pkg.github.com/csowada/ebus | |
run: mvn deploy --batch-mode --update-snapshots -P !sign,!build-extras,!deploy-ossrh,deploy-github -Dmaven.test.skip=true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create a new GitHub Release | |
uses: docker://antonyurchenko/git-release:latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DRAFT_RELEASE: "true" | |
PRE_RELEASE: "false" | |
CHANGELOG_FILE: "CHANGELOG.md" | |
ALLOW_EMPTY_CHANGELOG: "true" | |
# ALLOW_TAG_PREFIX: "true" | |
with: | |
args: | | |
target/*.jar |