Release to Maven Central #301
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
on: | |
- workflow_dispatch | |
name: Release to Maven Central | |
jobs: | |
release: | |
name: Build and release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "14" | |
- run: scripts/setup-signing-key.sh | |
env: | |
DECRYPTER: ${{ secrets.DECRYPTER }} | |
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
PASSPHRASE: ${{ secrets.PASSPHRASE }} | |
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }} | |
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }} | |
- name: Build and Release | |
run: export VERSION="1.0.0-`date '+%Y%m%d%H%M%S'`"; ./gradlew -Pversion=$VERSION clean check publishMavenPublicationToSonatype closeAndReleaseSonatypeStagingRepository writeVersionToReadme | |
env: | |
CTP_OSS_USER: ${{ secrets.OSS_USER }} | |
CTP_OSS_SECRET: ${{ secrets.OSS_SECRET }} | |
- uses: stefanzweifel/git-auto-commit-action@v4.6.0 | |
with: | |
file_pattern: "scripts/install.sh" | |
commit_message: "TASK: Updating version in README" | |
commit_user_name: Auto Mation | |
commit_user_email: automation@commercetools.com | |
commit_author: Auto Mation <automation@commercetools.com> |