v0.10.22 #22
Workflow file for this run
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
name: Release Published | |
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@v4 | |
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 assets | |
uses: robinraju/release-downloader@v1.2 | |
with: | |
repository: "liquibase/liquibase-sdk-maven-plugin" | |
tag: "${{ needs.setup.outputs.tag }}" | |
filename: "*" | |
out-file-path: "." | |
- name: Set up Java for publishing to Maven Central Repository | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '11' | |
distribution: 'adopt' | |
server-id: sonatype-nexus-staging | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key: ${{ secrets.GPG_SECRET }} | |
gpg-passphrase: GPG_PASSPHRASE | |
env: | |
GPG_PASSWORD: ${{ secrets.GPG_PASSPHRASE }} | |
- name: Stage to Sonatype | |
env: | |
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.SONATYPE_TOKEN }} | |
GPG_PASSWORD: ${{ secrets.GPG_PASSPHRASE }} | |
run: | | |
version=${{ needs.setup.outputs.version }} | |
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-sdk-maven-plugin-${version}.pom.xml \ | |
-DgeneratePom=false \ | |
-Dfile=liquibase-sdk-maven-plugin-${version}.jar \ | |
-Dsources=liquibase-sdk-maven-plugin-${version}-sources.jar \ | |
-Djavadoc=liquibase-sdk-maven-plugin-${version}-javadoc.jar \ | |
-Dfiles=liquibase-sdk-maven-plugin-${version}.jar.asc,liquibase-sdk-maven-plugin-${version}-sources.jar.asc,liquibase-sdk-maven-plugin-${version}-javadoc.jar.asc,liquibase-sdk-maven-plugin-${version}.pom.xml.asc \ | |
-Dtypes=jar.asc,jar.asc,jar.asc,pom.asc \ | |
-Dclassifiers=,sources,javadoc, | |
echo "File has been staged to sonatype. It must be manually closed and released when ready" |