Skip to content

Commit

Permalink
Merge pull request #610 from liquibase/DAT-16149-5
Browse files Browse the repository at this point in the history
DAT-16149 DevOps :: Extensions Release Failing
  • Loading branch information
jandroav authored Oct 26, 2023
2 parents 8c866bd + ec7797d commit 25e7ff9
Show file tree
Hide file tree
Showing 7 changed files with 158 additions and 96 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/attach-artifact-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ on:
jobs:

attach-artifact-to-release:
uses: liquibase/build-logic/.github/workflows/extension-attach-artifact-release.yml@v0.4.6
uses: liquibase/build-logic/.github/workflows/extension-attach-artifact-release.yml@v0.5.5
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ permissions:

jobs:
create-release:
uses: liquibase/build-logic/.github/workflows/create-release.yml@v0.4.6
uses: liquibase/build-logic/.github/workflows/create-release.yml@v0.5.5
secrets: inherit
97 changes: 86 additions & 11 deletions .github/workflows/release-published.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,89 @@ permissions:
pull-requests: write

jobs:
release-hibernate6:
uses: liquibase/build-logic/.github/workflows/extension-release-published.yml@DAT-16025
with:
branch: 'main'
secrets: inherit

release-hibernate5:
uses: liquibase/build-logic/.github/workflows/extension-release-published.yml@DAT-16025
with:
branch: 'hibernate5'
secrets: inherit
release:
name: "Release ${{ matrix.artifact.name }}"
strategy:
fail-fast: false
matrix:
artifact: [
{name: hibernate6, branch: main},
{name: hibernate5, branch: hibernate5},
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.artifact.branch }}

- 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 --hard HEAD~1
- name: Get Artifact ID
id: get-artifact-id
run: echo "artifact_id=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)" >> $GITHUB_ENV

- name: Download Release Artifacts
uses: robinraju/[email protected]
with:
tag: "${{ github.event.release.tag_name }}"
filename: "liquibase-${{ matrix.artifact.name }}-*"
out-file-path: "."

- name: Publish to Maven Central
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.SONATYPE_TOKEN }}
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://oss.sonatype.org/service/local/staging/deploy/maven2/ \
-DrepositoryId=sonatype-nexus-staging \
-DpomFile=${{ env.artifact_id }}-${version}.pom \
-DgeneratePom=false \
-Dfile=${{ env.artifact_id }}-${version}.jar \
-Dsources=${{ env.artifact_id }}-${version}-sources.jar \
-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,
- name: Prepare Maven Release
run: |
version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
git reset --hard HEAD~1
git tag -d liquibase-${{ matrix.artifact.name }}-${version}
mvn -B build-helper:parse-version versions:set 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" \
-DdevelopmentVersion=\${parsedVersion.majorVersion}.\${parsedVersion.nextMinorVersion}.0-SNAPSHOT -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.nextMinorVersion}.\${parsedVersion.incrementalVersion} \
-DcheckModificationExcludeList=pom.xml
- name: Release Rollback
if: failure()
run: |
mvn -B release:rollback \
-Dusername=liquibot -Dpassword=$GITHUB_TOKEN \
-Darguments="-Dmaven.javadoc.skip=true -Dmaven.test.skipTests=true -Dmaven.test.skip=true -Dmaven.deploy.skip=true" \
-DdevelopmentVersion=\${parsedVersion.majorVersion}.\${parsedVersion.nextMinorVersion}.\${parsedVersion.incrementalVersion}-SNAPSHOT -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.nextMinorVersion}.\${parsedVersion.incrementalVersion} \
-DconnectionUrl=scm:git:https://github.com/${{ github.repository }}.git -Dtag=\${parsedVersion.majorVersion}.\${parsedVersion.nextMinorVersion}.\${parsedVersion.incrementalVersion} \
-DcheckModificationExcludeList=pom.xml
14 changes: 0 additions & 14 deletions .github/workflows/snyk-nightly.yml

This file was deleted.

67 changes: 0 additions & 67 deletions .github/workflows/snyk.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ permissions:

jobs:
build-test:
uses: liquibase/build-logic/.github/workflows/os-extension-test.yml@v0.4.6
uses: liquibase/build-logic/.github/workflows/os-extension-test.yml@v0.5.5
secrets: inherit
with:
java: '[17, 18]'
Expand Down
70 changes: 69 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-parent-pom</artifactId>
<version>0.2.4</version> <!-- Replace with the desired version -->
<version>0.3.1</version> <!-- Replace with the desired version -->
</parent>

<groupId>org.liquibase.ext</groupId>
Expand Down Expand Up @@ -120,5 +120,73 @@
<!-- <version>2.0-groovy-3.0</version>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<reportFormat>plain</reportFormat>
<systemPropertyVariables>
<com.athaydes.spockframework.report.outputDir>${project.build.directory}/spock-reports</com.athaydes.spockframework.report.outputDir>
</systemPropertyVariables>
</configuration>
<dependencies>
<!-- Force using the latest JUnit 47 provider -->
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>${maven-surefire-plugin.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<reportFormat>plain</reportFormat>
<systemPropertyVariables>
<com.athaydes.spockframework.report.outputDir>${project.build.directory}/spock-reports</com.athaydes.spockframework.report.outputDir>
</systemPropertyVariables>
</configuration>
<dependencies>
<!-- Force using the latest JUnit 47 provider -->
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>${maven-surefire-plugin.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 25e7ff9

Please sign in to comment.