-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from liquibase/DAT-15578
DAT-15578 Change maven release perform on extensions build-logic
- Loading branch information
Showing
6 changed files
with
53 additions
and
28 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,13 @@ name: Create Release | |
on: | ||
workflow_call: | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
sonar: | ||
uses: liquibase/build-logic/.github/workflows/[email protected].4 | ||
uses: liquibase/build-logic/.github/workflows/[email protected].5 | ||
secrets: inherit | ||
|
||
create-release: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,10 +15,6 @@ on: | |
|
||
jobs: | ||
|
||
release-prepare: | ||
uses: liquibase/build-logic/.github/workflows/[email protected] | ||
secrets: inherit | ||
|
||
attach-to-release: | ||
name: Attach Artifact to Release | ||
if: github.event.pull_request.merged == true | ||
|
@@ -36,26 +32,29 @@ jobs: | |
|
||
- name: Get Reusable Script Files | ||
run: | | ||
curl -o $PWD/.github/get_draft_release.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.3.4/.github/get_draft_release.sh | ||
curl -o $PWD/.github/sign_artifact.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.3.4/.github/sign_artifact.sh | ||
curl -o $PWD/.github/upload_asset.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.3.4/.github/upload_asset.sh | ||
curl -o $PWD/.github/get_draft_release.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.3.5/.github/get_draft_release.sh | ||
curl -o $PWD/.github/sign_artifact.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.3.5/.github/sign_artifact.sh | ||
curl -o $PWD/.github/upload_asset.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.3.5/.github/upload_asset.sh | ||
chmod +x $PWD/.github/get_draft_release.sh | ||
chmod +x $PWD/.github/sign_artifact.sh | ||
chmod +x $PWD/.github/upload_asset.sh | ||
- name: Update branch with latest commits # needed for getting the latest pom.xml generated by release-prepare step | ||
- name: Configure Git | ||
run: | | ||
git config user.name "liquibot" | ||
git config user.email "[email protected]" | ||
- name: Build release artifacts | ||
id: build-release-artifacts | ||
run: | | ||
git pull origin ${{ env.GITHUB_REF_NAME }} | ||
git checkout HEAD~1 | ||
mvn -B release:clean release:prepare -Dusername=liquibot -Dpassword=$GITHUB_TOKEN -Darguments="-Dmaven.javadoc.skip=true -Dmaven.test.skipTests=true -Dmaven.test.skip=true -Dmaven.deploy.skip=true" -DreleaseVersion=${{ github.event.inputs.liquibaseVersion }} -DpushChanges=false | ||
git reset HEAD~ --hard | ||
mvn clean install -DskipTests | ||
- name: Get Artifact ID | ||
id: get-artifact-id | ||
run: echo "artifact_id=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)" >> $GITHUB_ENV | ||
|
||
- name: Build release artifacts | ||
id: build-release-artifacts | ||
run: mvn clean install -DskipTests | ||
|
||
- name: Get Release Tag | ||
id: get-release-tag | ||
run: echo "release_tag=$(./.github/get_draft_release.sh TAG)" >> $GITHUB_ENV | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,13 +9,38 @@ on: | |
SONATYPE_TOKEN: | ||
description: 'SONATYPE_TOKEN from the caller workflow' | ||
required: true | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Java for publishing to Maven Central Repository | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
server-id: sonatype-nexus-staging | ||
server-username: MAVEN_USERNAME | ||
server-password: MAVEN_PASSWORD | ||
|
||
- name: Configure Git | ||
run: | | ||
git config user.name "liquibot" | ||
git config user.email "[email protected]" | ||
- name: Build release artifacts | ||
id: build-release-artifacts | ||
run: | | ||
mvn -B release:clean release:prepare -Dusername=liquibot -Dpassword=$GITHUB_TOKEN -Darguments="-Dmaven.javadoc.skip=true -Dmaven.test.skipTests=true -Dmaven.test.skip=true -Dmaven.deploy.skip=true" -DreleaseVersion=${{ github.event.inputs.liquibaseVersion }} -DpushChanges=false | ||
git reset HEAD~ --hard | ||
- name: Get Artifact ID | ||
id: get-artifact-id | ||
run: echo "artifact_id=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)" >> $GITHUB_ENV | ||
|
@@ -27,16 +52,6 @@ jobs: | |
filename: "${{ env.artifact_id }}-*" | ||
out-file-path: "." | ||
|
||
- name: Set up Java for publishing to Maven Central Repository | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
server-id: sonatype-nexus-staging | ||
server-username: MAVEN_USERNAME | ||
server-password: MAVEN_PASSWORD | ||
|
||
- name: Publish to Maven Central | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
|
@@ -53,4 +68,9 @@ jobs: | |
-Djavadoc=${{ env.artifact_id }}-${version}-javadoc.jar \ | ||
-Dfiles=${{ env.artifact_id }}-${version}.jar.asc,${{ env.artifact_id }}-${version}-sources.jar.asc,${{ env.artifact_id }}-${version}-javadoc.jar.asc,${{ env.artifact_id }}-${version}.pom.asc \ | ||
-Dtypes=jar.asc,jar.asc,jar.asc,pom.asc \ | ||
-Dclassifiers=,sources,javadoc, | ||
-Dclassifiers=,sources,javadoc, | ||
release-prepare: | ||
needs: release | ||
uses: liquibase/build-logic/.github/workflows/[email protected] | ||
secrets: inherit |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,5 +78,5 @@ jobs: | |
sonar-pr: | ||
needs: [ unit-test ] | ||
uses: liquibase/build-logic/.github/workflows/[email protected].4 | ||
uses: liquibase/build-logic/.github/workflows/[email protected].5 | ||
secrets: inherit |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,5 +98,5 @@ jobs: | |
sonar-pr: | ||
needs: [ unit-test ] | ||
uses: liquibase/build-logic/.github/workflows/[email protected].4 | ||
uses: liquibase/build-logic/.github/workflows/[email protected].5 | ||
secrets: inherit |