Skip to content

publish

publish #6

Workflow file for this run

name: publish
on:
workflow_dispatch:
release:
types: [ released ]
jobs:
publish:
name: Release build and publish
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/[email protected]
with:
ref: ${{ github.event.release.tag_name }}
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Patch Changelog
run: |
./gradlew patchChangelog --release-note="`cat << EOM
${{ github.event.release.body }}
EOM`"
- name: Publish to MavenCentral
run: ./gradlew --no-configuration-cache \
-PsigningInMemoryKey=${{ secrets.SIGNING_KEY_SECRET }} \
-PsigningInMemoryKeyPassword=${{ secrets.SIGNING_KEY_PASSWORD }} \
-PmavenCentralUsername=${{ secrets.OSSRH_USERNAME }} \
-PmavenCentralPassword=${{ secrets.OSSRH_PSSWORD }} \
publish
- name: Create Pull Request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ github.event.release.tag_name }}"
BRANCH="changelog-update-$VERSION"
git config user.email "[email protected]"
git config user.name "GitHub Action"
git checkout -b $BRANCH
git commit -am "Changelog update - $VERSION"
git push --set-upstream origin $BRANCH
gh pr create \
--title "Changelog update - \`$VERSION\`" \
--body "Current pull request contains patched \`changelog.md\` file for the \`$VERSION\` version." \
--base master \
--head $BRANCH