Skip to content

Commit

Permalink
Merge branch 'snowdrop:main' into dockeropts
Browse files Browse the repository at this point in the history
  • Loading branch information
BarDweller authored Jul 5, 2024
2 parents 9c4b029 + fb6f150 commit 1bab70b
Show file tree
Hide file tree
Showing 8 changed files with 133 additions and 58 deletions.
3 changes: 3 additions & 0 deletions .github/project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
release:
current-version: 0.0.9
next-version: 0.0.10-SNAPSHOT
77 changes: 77 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Java Buildpack Client Release

on:
pull_request:
types: [closed]
paths:
- '.github/project.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
release:
runs-on: ubuntu-latest
name: release
if: ${{github.event.pull_request.merged == true}}

steps:
- uses: radcortez/project-metadata-action@main
name: Retrieve project metadata
id: metadata
with:
github-token: ${{secrets.GITHUB_TOKEN}}
metadata-file-path: '.github/project.yml'

- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: 'maven'
server-id: oss-sonatype-staging
server-username: OSS_SONATYPE_USERNAME
server-password: OSS_SONATYPE_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Configure Git author
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- name: Set release version in the samples and readme
run: |
find ./samples/ -iwholename "*/pack.java" | while read f; do
sed -i "s/dev.snowdrop:buildpack-client:.*/dev.snowdrop:buildpack-client:${{steps.metadata.outputs.current-version}}\}/g" $f
git add $f
done
sed -i "s/dev.snowdrop:buildpack-client:.*/dev.snowdrop:buildpack-client:${{steps.metadata.outputs.current-version}}\}/g" README.md
sed -i "s/<version>.*<\/version>/<version>${{steps.metadata.outputs.current-version}}<\/version>/g" README.md
git add README.md
git commit -m "chore: set release version: ${{steps.metadata.outputs.current-version}} in samples and README.md"
- name: Maven release ${{steps.metadata.outputs.current-version}}
run: |
mvn -B release:prepare -Prelease -Darguments="-DskipTests" -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}}
mvn -B release:perform -Darguments="-DperformRelease -DskipTests" -DperformRelease -Prelease
env:
OSS_SONATYPE_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
OSS_SONATYPE_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: Set dev version in the samples and readme
run: |
find ./samples/ -iwholename "*/pack.java" | while read f; do
sed -i "s/dev.snowdrop:buildpack-client:.*/dev.snowdrop:buildpack-client:${{steps.metadata.outputs.next-version}}\}/g" $f
git add $f
done
git commit -m "chore: set dev version: ${{steps.metadata.outputs.next-version}} in samples and README.md"
- name: Push changes to ${{github.base_ref}} branch
run: |
git push
git push origin ${{steps.metadata.outputs.current-version}}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Want to try out this project? The packages/api are not fixed in stone yet, so be
<dependency>
<groupId>dev.snowdrop</groupId>
<artifactId>buildpack-client</artifactId>
<version>0.0.XXX</version>
<version>0.0.9</version>
</dependency>
```

Expand Down Expand Up @@ -219,7 +219,7 @@ So, you can drop the following file in your project: (swap XXX for latest releas
```java
///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS dev.snowdrop:buildpack-client:0.0.XXX
//DEPS dev.snowdrop:buildpack-client:0.0.9}
import static java.lang.System.*;
import java.io.File;
Expand Down
2 changes: 1 addition & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>dev.snowdrop</groupId>
<artifactId>buildpack-client-project</artifactId>
<version>0.0.7-SNAPSHOT</version>
<version>0.0.10-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

Expand Down
58 changes: 48 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<modelVersion>4.0.0</modelVersion>
<groupId>dev.snowdrop</groupId>
<artifactId>buildpack-client-project</artifactId>
<version>0.0.7-SNAPSHOT</version>
<version>0.0.10-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Snowdrop :: Java Buildpack Client :: Project</name>
<description>A Buildpack client implementation written in Java</description>

<url>https://snowdrop.dev</url>
<url>http://github.com/snowdrop/java-buildpack-client</url>
<inceptionYear>2020</inceptionYear>

<organization>
Expand All @@ -34,8 +34,8 @@
</developers>

<scm>
<connection>scm:git:git@github.com:snowdrop/java-buildpack-client.git</connection>
<developerConnection>scm:git:[email protected]:snowdrop/java-buildpack-client.git</developerConnection>
<connection>scm:git:git://github.com/snowdrop/java-buildpack-client.git</connection>
<developerConnection>scm:git:ssh://[email protected]:snowdrop/java-buildpack-client.git</developerConnection>
<url>http://github.com/snowdrop/java-buildpack-client</url>
<tag>${project.version}</tag>
</scm>
Expand All @@ -46,6 +46,10 @@
<name>Sonatype Staging Repository</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
<snapshotRepository>
<id>oss-sonatype-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>

<properties>
Expand All @@ -63,15 +67,17 @@
<version.mockito>3.12.4</version.mockito>

<!-- Maven Plugin Versions -->
<version.maven-compiler-plugin>3.8.1</version.maven-compiler-plugin>
<version.maven-surefire-plugin>2.22.0</version.maven-surefire-plugin>
<version.maven-failsafe-plugin>2.22.0</version.maven-failsafe-plugin>
<version.maven-compiler-plugin>3.13.0</version.maven-compiler-plugin>
<version.maven-surefire-plugin>3.3.0</version.maven-surefire-plugin>
<version.maven-failsafe-plugin>3.3.0</version.maven-failsafe-plugin>

<!-- Release Plugins -->
<version.maven-gpg-plugin>1.6</version.maven-gpg-plugin>
<version.maven-release-plugin>3.1.0</version.maven-release-plugin>
<version.maven-gpg-plugin>3.2.4</version.maven-gpg-plugin>
<version.maven-enforcer-plugin>1.3.1</version.maven-enforcer-plugin>
<version.maven-javadoc-plugin>2.10.3</version.maven-javadoc-plugin>
<version.maven-source-plugin>2.4</version.maven-source-plugin>
<version.maven-javadoc-plugin>3.7.0</version.maven-javadoc-plugin>
<version.maven-source-plugin>3.3.1</version.maven-source-plugin>
<version.nexus-staging-maven-plugin>1.6.13</version.nexus-staging-maven-plugin>
</properties>

<modules>
Expand Down Expand Up @@ -212,6 +218,13 @@
<goals>
<goal>sign</goal>
</goals>
<configuration>
<!-- This is necessary for gpg to not try to use the pinentry programs -->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
Expand Down Expand Up @@ -272,6 +285,31 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>${version.maven-release-plugin}</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<tagNameFormat>@{project.version}</tagNameFormat>
<pushChanges>false</pushChanges>
<localCheckout>true</localCheckout>
<remoteTagging>false</remoteTagging>
<arguments>-DskipTests=true</arguments>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>${version.nexus-staging-maven-plugin}</version>
<extensions>true</extensions>
<configuration>
<serverId>oss-sonatype-staging</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<stagingProgressTimeoutMinutes>60</stagingProgressTimeoutMinutes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
Expand Down
43 changes: 0 additions & 43 deletions release.sh

This file was deleted.

2 changes: 1 addition & 1 deletion samples/hello-quarkus/pack.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

//REPOS mavencentral,jitpack
//DEPS org.slf4j:slf4j-simple:1.7.30
//DEPS ${env.CURRENT_WORKFLOW_DEP:dev.snowdrop:buildpack-client:0.0.7-SNAPSHOT}
//DEPS ${env.CURRENT_WORKFLOW_DEP:dev.snowdrop:buildpack-client:0.0.10-SNAPSHOT}


import java.io.File;
Expand Down
2 changes: 1 addition & 1 deletion samples/hello-spring/pack.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

//REPOS mavencentral,jitpack
//DEPS org.slf4j:slf4j-simple:1.7.30
//DEPS ${env.CURRENT_WORKFLOW_DEP:dev.snowdrop:buildpack-client:0.0.7-SNAPSHOT}
//DEPS ${env.CURRENT_WORKFLOW_DEP:dev.snowdrop:buildpack-client:0.0.10-SNAPSHOT}

import java.io.File;
import java.util.HashMap;
Expand Down

0 comments on commit 1bab70b

Please sign in to comment.