Skip to content

Commit

Permalink
Merge pull request #23 from liquibase/test-workflow
Browse files Browse the repository at this point in the history
renaming to parent pom
  • Loading branch information
jandroav authored Sep 14, 2023
2 parents 6362430 + 2c6ed05 commit 66b373e
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 133 deletions.
4 changes: 2 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

name-template: 'Liquibase Super POM v$RESOLVED_VERSION'
name-template: 'Liquibase Parent POM v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
exclude-labels:
- 'skipReleaseNotes'
Expand Down Expand Up @@ -49,5 +49,5 @@ template: |
$CHANGES
**Full Changelog**: https://github.com/liquibase/liquibase-mongodb/compare/liquibase-mongodb-$PREVIOUS_TAG...liquibase-mongodb-$RESOLVED_VERSION
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...$REPOSITORY-$RESOLVED_VERSION
4 changes: 2 additions & 2 deletions .github/workflows/attach-artifact-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:

- name: Get Reusable Script Files
run: |
curl -o $PWD/.github/get_draft_release.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.4.1/.github/get_draft_release.sh
curl -o $PWD/.github/sign_artifact.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.4.1/.github/sign_artifact.sh
curl -o $PWD/.github/get_draft_release.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.4.2/.github/get_draft_release.sh
curl -o $PWD/.github/sign_artifact.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.4.2/.github/sign_artifact.sh
chmod +x $PWD/.github/get_draft_release.sh
chmod +x $PWD/.github/sign_artifact.sh
chmod +x $PWD/.github/upload_asset.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
nightly-build:
uses: liquibase/build-logic/.github/workflows/[email protected].1
uses: liquibase/build-logic/.github/workflows/[email protected].2
with:
nightly: true
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 @@ -7,5 +7,5 @@ on:

jobs:
create-release:
uses: liquibase/build-logic/.github/workflows/[email protected].1
uses: liquibase/build-logic/.github/workflows/[email protected].2
secrets: inherit
48 changes: 2 additions & 46 deletions .github/workflows/release-published.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release Super POM to GitHub Packages
name: Release Parent POM to GitHub Packages

on:
workflow_dispatch:
Expand All @@ -11,49 +11,5 @@ permissions:

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'

- 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" -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

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

- name: Publish to GitHub Packages
run: |
version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
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 }}

maven-release:
needs: release
uses: liquibase/build-logic/.github/workflows/[email protected]
uses: liquibase/build-logic/.github/workflows/[email protected]
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/snyk-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ on:

jobs:
security-scan:
uses: liquibase/build-logic/.github/workflows/[email protected].1
uses: liquibase/build-logic/.github/workflows/[email protected].2
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ on:

jobs:
build-test:
uses: liquibase/build-logic/.github/workflows/[email protected].1
uses: liquibase/build-logic/.github/workflows/[email protected].2
secrets: inherit
77 changes: 6 additions & 71 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,93 +1,28 @@
# :star: Liquibase Super POM
# :star: Liquibase Parent POM

Simplifying Extension Dependency Management with Super POM
Simplifying Extension Dependency Management with Parent POM

This repository helps craft a parent/super POM file that becomes the central parent for all extension repositories.
This repository helps craft a parent POM file that becomes the central parent for all extension repositories.

## :pushpin: Features

- Centralized configuration for Liquibase extension projects.
- Easy inheritance for common settings and plugins.
- Simplifies project management and distribution.

## :wrench: Prerequisites

GitHub actions must be configured to get artifacts from GitHub Package Manager:

```yaml
# look for dependencies in maven
- name: maven-settings-xml-action
uses: whelk-io/maven-settings-xml-action@v20
with:
repositories: |
[
{
"id": "liquibase",
"url": "https://maven.pkg.github.com/liquibase/liquibase",
"releases": {
"enabled": "false"
},
"snapshots": {
"enabled": "true",
"updatePolicy": "always"
}
},
{
"id": "liquibase-pro",
"url": "https://maven.pkg.github.com/liquibase/liquibase-pro",
"releases": {
"enabled": "false"
},
"snapshots": {
"enabled": "true",
"updatePolicy": "always"
}
},
{
"id": "liquibase-super-pom",
"url": "https://maven.pkg.github.com/liquibase/liquibase-super-pom",
"releases": {
"enabled": "true"
},
"snapshots": {
"enabled": "true",
"updatePolicy": "always"
}
}
]
servers: |
[
{
"id": "liquibase-pro",
"username": "liquibot",
"password": "${{ secrets.LIQUIBOT_PAT }}"
},
{
"id": "liquibase",
"username": "liquibot",
"password": "${{ secrets.LIQUIBOT_PAT }}"
},
{
"id": "liquibase-super-pom",
"username": "liquibot",
"password": "${{ secrets.LIQUIBOT_PAT }}"
}
]
```
## :wrench: Usage

1. Add the following to your Liquibase extension project's `pom.xml` to inherit from this super POM:
1. Add the following to your Liquibase extension project's `pom.xml` to inherit from this parent POM:

```xml
<parent>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-super-pom</artifactId>
<artifactId>liquibase-parent-pom</artifactId>
<version>0.0.1</version> <!-- Replace with the desired version -->
</parent>
```

2. Customize your extension project as needed. Your project inherits common properties, plugins, and distribution management settings from this super POM.
2. Customize your extension project as needed. Your project inherits common properties, plugins, and distribution management settings from this parent POM.

## :rocket: Contributing

Expand Down
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-super-pom</artifactId>
<name>Super POM</name>
<version>0.1.1-SNAPSHOT</version>
<description>Super POM for all Extensions</description>
<artifactId>liquibase-parent-pom</artifactId>
<name>Parent POM</name>
<version>0.0.1-SNAPSHOT</version>
<description>Parent POM for all Extensions</description>
<packaging>pom</packaging>

<issueManagement>
Expand Down Expand Up @@ -525,9 +525,9 @@
</snapshots>
</repository>
<repository>
<id>liquibase-super-pom</id>
<id>liquibase-parent-pom</id>
<name>This repository</name>
<url>https://maven.pkg.github.com/liquibase/liquibase-super-pom</url>
<url>https://maven.pkg.github.com/liquibase/liquibase-parent-pom</url>
</repository>
</repositories>
</profile>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.liquibase.superpom;
public interface Superpom {
public interface ParentPom {

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import org.junit.jupiter.api.Test;

public class Superpom {
public class ParTest {

@Test
void whenTestCase_thenPass() {
Expand Down

0 comments on commit 66b373e

Please sign in to comment.