Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: improve build extension script #245

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 39 additions & 8 deletions .github/workflows/build-extension-jar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,45 @@ on:
required: true
default: ""
type: string
extension-version:
description: "The version that will be defined to the extensions. Defaults to master-SNAPSHOT"
required: false
default: "master-SNAPSHOT"
type: string
submodule:
description: "Maven submodule to cd into"
required: false
default: ""
type: string
branch:
description: "Branch to checkout"
required: false
default: "main"
type: string


workflow_dispatch:
inputs:
extension:
description: "Extension to build"
required: true
default: ""
type: string
extension-version:
description: "The version that will be defined to the extensions. Defaults to master-SNAPSHOT"
required: false
default: "master-SNAPSHOT"
type: string
submodule:
description: "Maven submodule to cd into"
required: false
default: ""
type: string
branch:
description: "Branch to checkout"
required: false
default: "main"
type: string


jobs:
Expand Down Expand Up @@ -43,7 +75,7 @@ jobs:
run: |
git config --global credential.helper store
echo "https://$GIT_USERNAME:[email protected]" > ~/.git-credentials
git clone https://github.com/liquibase/${{ inputs.extension }}.git ${{ inputs.extension }}
git clone https://github.com/liquibase/${{ inputs.extension }}.git --branch ${{ inputs.branch }} ${{ inputs.extension }}

- name: Set up JDK 21
uses: actions/setup-java@v4
Expand Down Expand Up @@ -103,15 +135,14 @@ jobs:
env:
GPG_PASSWORD: ${{ secrets.GPG_PASSPHRASE }}
run: |
cd ${{ inputs.extension }}
EXTENSION_VERSION="master-SNAPSHOT"
cd ${{ inputs.extension }}/${{ inputs.submodule }}
mvn versions:set -DnewVersion=$EXTENSION_VERSION
mvn clean install -DskipTests
mvn deploy:deploy-file \
-Dfile=./target/${{ inputs.extension }}-$EXTENSION_VERSION.jar \
-Dsources=./target/${{ inputs.extension }}-$EXTENSION_VERSION-sources.jar \
-Djavadoc=./target/${{ inputs.extension }}-$EXTENSION_VERSION-javadoc.jar \
mvn deploy:deploy-file \
-Dfile=./target/${{ inputs.extension }}-${{ inputs.extension-version }}.jar \
-Dsources=./target/${{ inputs.extension }}-${{ inputs.extension-version }}-sources.jar \
-Djavadoc=./target/${{ inputs.extension }}-${{ inputs.extension-version }}-javadoc.jar \
-DrepositoryId=liquibase \
-Durl=https://maven.pkg.github.com/liquibase/${{ inputs.extension }} \
-DpomFile=pom.xml
cd ..
cd -