Skip to content

Workflow file for this run

name: Build and publish artifact
on:
release:
types: [published]
env:
NEW_VERSION: ${{ github.event.release.tag_name }}
jobs:
build_and_release:
runs-on: ubuntu-latest
steps:
- name: Setup java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('build.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-cache-
- uses: actions/cache@v3
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-wrapper-
- name: build artifact
run: ./gradlew -Pversion=${{ env.NEW_VERSION }} build
- name: upload artifact
run: ./gradlew -Pversion=${{ env.NEW_VERSION }} publish
env:
GITHUB_USERNAME: x-access-token
GITHUB_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}