Skip to content

v4.23.2

v4.23.2 #34

name: Release Extension to Sonatype
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: 'Release Tag'
required: true
jobs:
setup:
name: Setup
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.collect-data.outputs.tag }}
version: ${{ steps.collect-data.outputs.version }}
steps:
- name: Collect Data
id: collect-data
uses: actions/github-script@v6
with:
script: |
let tag;
if (context.payload.inputs) {
tag = context.payload.inputs.tag;
} else {
tag = context.payload.release.tag_name;
}
let version = tag.replace(/^v/, "");
core.setOutput("tag", tag);
core.setOutput("version", version);
- run: |
echo "Publishing version ${{ steps.collect-data.outputs.version }} from ${{ steps.collect-data.outputs.tag }}"
deploy_maven:
name: Deploy to Maven
needs: [ setup ]
runs-on: ubuntu-latest
steps:
- name: Download Release Artifacts
uses: robinraju/[email protected]
with:
tag: "${{ needs.setup.outputs.tag }}"
filename: "*"
out-file-path: "."
- name: Set up Java for publishing to Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
server-id: sonatype-nexus-staging
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Publish to Maven Central
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.SONATYPE_TOKEN }}
run: |
version=${{ needs.setup.outputs.version }}
unzip *.zip
mvn -B org.apache.maven.plugins:maven-deploy-plugin:3.0.0-M1:deploy-file \
-Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ \
-DrepositoryId=sonatype-nexus-staging \
-DpomFile=liquibase-maxdb-${version}.pom \
-DgeneratePom=false \
-Dfile=liquibase-maxdb-${version}.jar \
-Dsources=liquibase-maxdb-${version}-sources.jar \
-Djavadoc=liquibase-maxdb-${version}-javadoc.jar \
-Dfiles=liquibase-maxdb-${version}.jar.asc,liquibase-maxdb-${version}-sources.jar.asc,liquibase-maxdb-${version}-javadoc.jar.asc,liquibase-maxdb-${version}.pom.asc \
-Dtypes=jar.asc,jar.asc,jar.asc,pom.asc \
-Dclassifiers=,sources,javadoc,