From ce690b1e2d669628d6a11676e3ada49c667876a1 Mon Sep 17 00:00:00 2001 From: Chayim Date: Sun, 16 Jan 2022 11:26:53 +0200 Subject: [PATCH] lifting github workflows to 2.4 (#335) --- .github/release-drafter-config.yml | 21 ++++++++++ .github/workflows/release-drafter.yml | 19 +++++++++ .github/workflows/version-and-release.yml | 47 +++++++++++++++++++++++ pom.xml | 8 +++- 4 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 .github/release-drafter-config.yml create mode 100644 .github/workflows/release-drafter.yml create mode 100644 .github/workflows/version-and-release.yml diff --git a/.github/release-drafter-config.yml b/.github/release-drafter-config.yml new file mode 100644 index 00000000..229b9e00 --- /dev/null +++ b/.github/release-drafter-config.yml @@ -0,0 +1,21 @@ +name-template: 'Version $NEXT_PATCH_VERSION🌈' +tag-template: 'v$NEXT_PATCH_VERSION' +categories: + - title: '🚀Features' + labels: + - 'feature' + - 'enhancement' + - title: 'Bug Fixes' + labels: + - 'fix' + - 'bugfix' + - 'bug' + - title: '🧰Maintenance' + label: 'chore' +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +exclude-labels: + - 'skip-changelog' +template: | + ## Changes + + $CHANGES \ No newline at end of file diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 00000000..c2050145 --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,19 @@ +name: Release Drafter + +on: + push: + # branches to consider in the event; optional, defaults to all + branches: + - master + +jobs: + update_release_draft: + runs-on: ubuntu-latest + steps: + # Drafts your next Release notes as Pull Requests are merged into "master" + - uses: release-drafter/release-drafter@v5 + with: + # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml + config-name: release-drafter-config.yml + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/version-and-release.yml b/.github/workflows/version-and-release.yml new file mode 100644 index 00000000..8ea1964d --- /dev/null +++ b/.github/workflows/version-and-release.yml @@ -0,0 +1,47 @@ +name: Release + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: get version from tag + id: get_version + run: | + realversion="${GITHUB_REF/refs\/tags\//}" + realversion="${realversion//v/}" + realversion=`echo ${realversion}|cut -d '-' -f 2-2` + echo "::set-output name=VERSION::$realversion" + + - name: Set up publishing to maven central + uses: actions/setup-java@v2 + with: + java-version: '8' + distribution: 'adopt' + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + + - name: mvn versions + run: mvn versions:set -DnewVersion=${{ steps.get_version.outputs.VERSION }} + + - name: Install gpg key + run: | + cat <(echo -e "${{ secrets.OSSH_GPG_SECRET_KEY }}") | gpg --batch --import + gpg --list-secret-keys --keyid-format LONG + + - name: Publish + run: | + mvn --no-transfer-progress \ + --batch-mode \ + -Dgpg.passphrase='${{ secrets.OSSH_GPG_SECRET_KEY_PASSWORD }}' \ + -DskipTests deploy -P release + env: + MAVEN_USERNAME: ${{secrets.OSSH_USERNAME}} + MAVEN_PASSWORD: ${{secrets.OSSH_TOKEN}} diff --git a/pom.xml b/pom.xml index a21df45a..6abfd4b7 100644 --- a/pom.xml +++ b/pom.xml @@ -370,7 +370,13 @@ org.apache.maven.plugins maven-gpg-plugin - 1.5 + 3.0.1 + + + --pinentry-mode + loopback + + sign-artifacts