Skip to content
Draft
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ on: [push, pull_request]
jobs:
build:
name: Build
if: "!contains(github.event.head_commit.message, '[maven-release-plugin]')"
if: "github.repository == 'finos/legend-shared'"
runs-on: ubuntu-latest
steps:
- name: Checkout repo
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/clean-after-failed-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
# limitations under the License.


# This action deletes the last two commits made on the master branch and the latest tag
# This should only be run if a release failed and the remote staging repo has been dropped:
# [ERROR] * Dropping failed staging repository with ID "orgfinoslegend-..." ...
# This action deletes the latest tag after a failed release.
# With CI-friendly versions, there are no release commits to clean up — only the tag.
name: Clean repo after failed release

on: [workflow_dispatch]
Expand All @@ -39,5 +38,3 @@ jobs:
run: |
LATEST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
git push --delete origin $LATEST_TAG
git reset --hard HEAD~2
git push --force
33 changes: 20 additions & 13 deletions .github/workflows/legend-stack-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,29 @@ jobs:
gpg-private-key: ${{ secrets.CI_GPG_PRIVATE_KEY }}
gpg-passphrase: CI_GPG_PASSPHRASE

- name: Compute next development version
run: |
releaseVersion=${{ github.event.client_payload.releaseVersion }}
n=${releaseVersion//[!0-9]/ }
a=(${n//\./ })
nextPatch=$((${a[2]} + 1))
developmentVersion="${a[0]}.${a[1]}.${nextPatch}-SNAPSHOT"
echo "DEVELOPMENT_VERSION=${developmentVersion}" >> $GITHUB_ENV

- name: Collect Workflow Telemetry
uses: runforesight/workflow-telemetry-action@v1
with:
theme: dark

- name: Prepare release
run: mvn -B -DpreparationGoals=clean release:prepare -DreleaseVersion=${{ github.event.client_payload.releaseVersion }} -DdevelopmentVersion=${{ env.DEVELOPMENT_VERSION }} -P release
- name: Build and deploy release
run: |
mvn -B -e -Drevision=${{ github.event.client_payload.releaseVersion }} \
deploy -P release,docker

- name: Create and push git tag
run: |
git tag ${{ github.event.repository.name }}-${{ github.event.client_payload.releaseVersion }}
git push origin ${{ github.event.repository.name }}-${{ github.event.client_payload.releaseVersion }}

- name: Perform release
run: mvn -B release:perform -P release,docker
- name: Compute and set next SNAPSHOT
run: |
releaseVersion=${{ github.event.client_payload.releaseVersion }}
n=${releaseVersion//[!0-9]/ }
a=(${n//\./ })
nextPatch=$((${a[2]} + 1))
nextSnapshot="${a[0]}.${a[1]}.${nextPatch}-SNAPSHOT"
sed -i "s|<revision>.*</revision>|<revision>${nextSnapshot}</revision>|" pom.xml
git add pom.xml
git commit -m "Bump version to ${nextSnapshot}"
git push origin master
49 changes: 23 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,42 +54,27 @@ jobs:
gpg-private-key: ${{ secrets.CI_GPG_PRIVATE_KEY }}
gpg-passphrase: CI_GPG_PASSPHRASE

- name: Compute next development version
run: |
releaseVersion=${{ github.event.inputs.releaseVersion }}
n=${releaseVersion//[!0-9]/ }
a=(${n//\./ })
nextPatch=$((${a[2]} + 1))
developmentVersion="${a[0]}.${a[1]}.${nextPatch}-SNAPSHOT"
echo "DEVELOPMENT_VERSION=${developmentVersion}" >> $GITHUB_ENV

- name: Collect Workflow Telemetry
uses: runforesight/workflow-telemetry-action@v1
with:
theme: dark

- name: Prepare release
run: mvn -B -DpreparationGoals=clean release:prepare -DreleaseVersion=${{ github.event.inputs.releaseVersion }} -DdevelopmentVersion=${{ env.DEVELOPMENT_VERSION }} -P release

- name: Checkout the latest tag
run: |
mkdir -p target/checkout
git clone --depth 1 --branch ${{ github.event.repository.name }}-${{ github.event.inputs.releaseVersion }} https://github.com/${{ github.repository }}.git target/checkout

- name: Build the latest tag
working-directory: target/checkout
run: mvn -B -e -T2 -DskipTests install -P release,docker
- name: Build release
run: mvn -B -e -T2 -DskipTests -Drevision=${{ github.event.inputs.releaseVersion }} install -P release,docker
env:
MAVEN_OPTS: -Xmx14g

- name: Test the latest tag
working-directory: target/checkout
run: mvn -B -e -T2 -DargLine="-Xmx6g" surefire:test -P release,docker
- name: Test release
run: mvn -B -e -T2 -DargLine="-Xmx6g" -Drevision=${{ github.event.inputs.releaseVersion }} surefire:test -P release,docker
env:
MAVEN_OPTS: -Xmx2g

- name: Create and push git tag
run: |
git tag ${{ github.event.repository.name }}-${{ github.event.inputs.releaseVersion }}
git push origin ${{ github.event.repository.name }}-${{ github.event.inputs.releaseVersion }}

- name: Create bundle to publish
working-directory: target/checkout
run: |
mkdir -p central-staging/org/finos/legend
cp -R ~/.m2/repository/org/finos/legend/shared central-staging/org/finos/legend
Expand All @@ -100,12 +85,12 @@ jobs:
sha256sum "$file" | awk '{print $1}' > "$file.sha256"
sha512sum "$file" | awk '{print $1}' > "$file.sha512"
done

mkdir central-publishing
cd central-staging && zip -r ../central-publishing/central-bundle.zip org

- name: Publish bundle
working-directory: target/checkout/central-publishing
working-directory: central-publishing
run: |
token=$(printf "$CI_DEPLOY_USERNAME:$CI_DEPLOY_PASSWORD" | base64)
httpCode=$(curl -s -o response.json -w "%{http_code}" -X POST -H "Authorization: Bearer $token" --form bundle=@central-bundle.zip https://central.sonatype.com/api/v1/publisher/upload?publishingType=AUTOMATIC)
Expand Down Expand Up @@ -140,3 +125,15 @@ jobs:
exit 1
fi
done

- name: Compute and set next SNAPSHOT
run: |
releaseVersion=${{ github.event.inputs.releaseVersion }}
n=${releaseVersion//[!0-9]/ }
a=(${n//\./ })
nextPatch=$((${a[2]} + 1))
nextSnapshot="${a[0]}.${a[1]}.${nextPatch}-SNAPSHOT"
sed -i "s|<revision>.*</revision>|<revision>${nextSnapshot}</revision>|" pom.xml
git add pom.xml
git commit -m "Bump version to ${nextSnapshot}"
git push origin master
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
**/target
**/surefire-reports-aggregate
**/dependency-reduced-pom.xml
**/.flattened-pom.xml
.vscode
.settings
.project
Expand Down
2 changes: 1 addition & 1 deletion legend-shared-opentracing-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.finos.legend.shared</groupId>
<artifactId>legend-shared</artifactId>
<version>0.34.1-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<artifactId>legend-shared-opentracing-base</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion legend-shared-opentracing-jersey/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>legend-shared</artifactId>
<groupId>org.finos.legend.shared</groupId>
<version>0.34.1-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<artifactId>legend-shared-opentracing-jersey</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion legend-shared-opentracing-servlet-filter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.finos.legend.shared</groupId>
<artifactId>legend-shared</artifactId>
<version>0.34.1-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<artifactId>legend-shared-opentracing-servlet-filter</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion legend-shared-opentracing-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.finos.legend.shared</groupId>
<artifactId>legend-shared</artifactId>
<version>0.34.1-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<artifactId>legend-shared-opentracing-test</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion legend-shared-pac4j-gitlab/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.finos.legend.shared</groupId>
<artifactId>legend-shared</artifactId>
<version>0.34.1-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<artifactId>legend-shared-pac4j-gitlab</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion legend-shared-pac4j-kerberos/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.finos.legend.shared</groupId>
<artifactId>legend-shared</artifactId>
<version>0.34.1-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<artifactId>legend-shared-pac4j-kerberos</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion legend-shared-pac4j-ping/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>legend-shared</artifactId>
<groupId>org.finos.legend.shared</groupId>
<version>0.34.1-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<artifactId>legend-shared-pac4j-ping</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion legend-shared-pac4j/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.finos.legend.shared</groupId>
<artifactId>legend-shared</artifactId>
<version>0.34.1-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<artifactId>legend-shared-pac4j</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion legend-shared-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.finos.legend.shared</groupId>
<artifactId>legend-shared</artifactId>
<version>0.34.1-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<artifactId>legend-shared-server</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion legend-shared-test-reports/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.finos.legend.shared</groupId>
<artifactId>legend-shared</artifactId>
<version>0.34.1-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<artifactId>legend-shared-test-reports</artifactId>
Expand Down
30 changes: 29 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@
<name>Legend Shared</name>
<groupId>org.finos.legend.shared</groupId>
<artifactId>legend-shared</artifactId>
<version>0.34.1-SNAPSHOT</version>
<version>${revision}</version>
<packaging>pom</packaging>

<properties>
<!-- CI-Friendly Version -->
<revision>0.34.1-SNAPSHOT</revision>

<sonar.projectKey>legend-shared</sonar.projectKey>
<sonar.moduleKey>${project.groupId}:${project.artifactId}</sonar.moduleKey>

Expand Down Expand Up @@ -209,6 +212,31 @@
</pluginManagement>

<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>1.6.0</version>
<configuration>
<updatePomFile>true</updatePomFile>
<flattenMode>resolveCiFriendliesOnly</flattenMode>
</configuration>
<executions>
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
Expand Down
Loading