From 031f64d420a4094d5e0954dec9bb0fb2b85f7eb7 Mon Sep 17 00:00:00 2001 From: jandroav Date: Tue, 12 Sep 2023 11:09:13 +0200 Subject: [PATCH 1/2] chore(release-published.yml): update workflow name to reflect the purpose of releasing the Super POM to GitHub Packages chore(release-published.yml): remove unnecessary options from the mvn deploy-file command to simplify the deployment process chore(pom.xml): add GitHub repository as a repository source for the project dependencies --- .github/workflows/release-published.yml | 10 +++------- pom.xml | 8 ++++++++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release-published.yml b/.github/workflows/release-published.yml index b002af8..6298b81 100644 --- a/.github/workflows/release-published.yml +++ b/.github/workflows/release-published.yml @@ -1,4 +1,4 @@ -name: Release Extension to Sonatype +name: Release Super POM to GitHub Packages on: workflow_dispatch: @@ -48,12 +48,8 @@ jobs: - name: Publish to GitHub Packages run: | - version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) - mvn -B org.apache.maven.plugins:maven-deploy-plugin:3.0.0-M1:deploy-file \ - -Durl=https://maven.pkg.github.com/liquibase/liquibase-super-pom \ - -DpomFile=${{ env.artifact_id }}-${version}.pom \ - -DgeneratePom=true \ - -Dfile=${{ env.artifact_id }}-${version}.pom \ + version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + mvn deploy:deploy-file -DpomFile=${{ env.artifact_id }}-${version}.pom -Dfile=${{ env.artifact_id }}-${version}.pom -DrepositoryId=github -Durl=https://maven.pkg.github.com/liquibase/liquibase-super-pom env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/pom.xml b/pom.xml index 00d35d3..d22d9c1 100644 --- a/pom.xml +++ b/pom.xml @@ -74,6 +74,14 @@ + + + github + This repository + https://maven.pkg.github.com/liquibase/${project.artifactId} + + + org.liquibase From bdff9e03edb4a8f31cf711b36fb301e397120f46 Mon Sep 17 00:00:00 2001 From: jandroav Date: Tue, 12 Sep 2023 11:09:41 +0200 Subject: [PATCH 2/2] fix(release-published.yml): add username and password parameters to the mvn deploy command to authenticate with GitHub Packages The username and password parameters are added to the `mvn deploy` command in order to authenticate with GitHub Packages. This allows the artifact to be published to the GitHub Packages repository. --- .github/workflows/release-published.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-published.yml b/.github/workflows/release-published.yml index 6298b81..21086bb 100644 --- a/.github/workflows/release-published.yml +++ b/.github/workflows/release-published.yml @@ -49,7 +49,7 @@ jobs: - name: Publish to GitHub Packages run: | version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) - mvn deploy:deploy-file -DpomFile=${{ env.artifact_id }}-${version}.pom -Dfile=${{ env.artifact_id }}-${version}.pom -DrepositoryId=github -Durl=https://maven.pkg.github.com/liquibase/liquibase-super-pom + mvn deploy:deploy-file -Dusername=liquibot -Dpassword=$GITHUB_TOKEN -DpomFile=${{ env.artifact_id }}-${version}.pom -Dfile=${{ env.artifact_id }}-${version}.pom -DrepositoryId=github -Durl=https://maven.pkg.github.com/liquibase/liquibase-super-pom env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}