Skip to content

cd

cd #4

Workflow file for this run

name: cd
on:
push:
tags:
- "*"
jobs:
validation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate tag is valid
run: |
echo "${{ github.ref_name }}" | grep -P '^[0-9]+\.[0-9]+\.[0-9]+'
main:
runs-on: ubuntu-latest
needs: validation
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.MAVEN_GPG_KEY }}
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Publish package to GHCR
uses: gradle/gradle-build-action@v2
with:
arguments: publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ github.ref_name }}
- name: Publish package to Central
uses: gradle/gradle-build-action@v2
with:
arguments: publishReleasePublicationToCentralPortal
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
VERSION: ${{ github.ref_name }}