Build For Liquibase #2
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: Build For Liquibase | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "5 6 * * *" | |
push: | |
branches: | |
- "main" | |
workflow_call: | |
inputs: | |
version: | |
required: true | |
description: "Version to publish" | |
type: string | |
repository: | |
required: true | |
description: "Repository to check out" | |
type: string | |
jobs: | |
build: | |
name: Build Extension | |
uses: liquibase/build-logic/.github/workflows/pro-extension-build-for-liquibase.yml@main | |
secrets: inherit | |
with: | |
os: '["ubuntu-latest", "macos-latest", "windows-latest"]' | |
java: "[17, 21]" | |
artifactPath: liquibase-checks | |
combineJars: true | |
repository: ${{ inputs.repository }} | |
version: ${{ inputs.version }} | |
publish-main-snapshots-to-gpm: | |
name: Publish to GPM | |
runs-on: ubuntu-latest | |
needs: [build] | |
permissions: | |
contents: read | |
packages: write | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GIT_USERNAME: "liquibot" | |
GIT_PASSWORD: ${{ secrets.LIQUIBOT_PAT_GPM_ACCESS }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ inputs.repository }} | |
token: ${{ secrets.BOT_TOKEN }} | |
- name: Download Multiplatform Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: multiplatform-artifacts | |
path: ./artifacts | |
- name: Verify renamed files | |
run: | | |
ls -l ./artifacts | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: "temurin" | |
cache: "maven" | |
#look for dependencies in maven | |
- name: maven-settings-xml-action | |
uses: whelk-io/maven-settings-xml-action@v22 | |
with: | |
repositories: | | |
[ | |
{ | |
"id": "liquibase", | |
"url": "https://maven.pkg.github.com/liquibase/liquibase", | |
"releases": { | |
"enabled": "true" | |
}, | |
"snapshots": { | |
"enabled": "true", | |
"updatePolicy": "always" | |
} | |
}, | |
{ | |
"id": "liquibase-pro", | |
"url": "https://maven.pkg.github.com/liquibase/liquibase-pro", | |
"releases": { | |
"enabled": "true" | |
}, | |
"snapshots": { | |
"enabled": "true", | |
"updatePolicy": "always" | |
} | |
} | |
] | |
servers: | | |
[ | |
{ | |
"id": "liquibase", | |
"username": "liquibot", | |
"password": "${{ secrets.LIQUIBOT_PAT_GPM_ACCESS }}" | |
}, | |
{ | |
"id": "liquibase-pro", | |
"username": "liquibot", | |
"password": "${{ secrets.LIQUIBOT_PAT_GPM_ACCESS }}" | |
} | |
] | |
- name: Publish to GitHub Packages | |
run: | | |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | |
mvn deploy:deploy-file \ | |
-Dfile="./artifacts/liquibase-checks-${{ inputs.version }}.jar" \ | |
-DgroupId=org.liquibase.ext \ | |
-DartifactId=liquibase-checks \ | |
-Dversion=${{ inputs.version }} \ | |
-Dpackaging=jar \ | |
-DrepositoryId=liquibase \ | |
-Durl=https://maven.pkg.github.com/${{ inputs.repository }} \ | |
-Dusername=liquibot \ | |
-Dpassword=${{ env.GIT_PASSWORD }} | |