-
Notifications
You must be signed in to change notification settings - Fork 642
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci : Enable publishing snapshot artifacts to maven central
Signed-off-by: Rohan Kumar <[email protected]>
- Loading branch information
1 parent
b5714b1
commit 3c1cf3f
Showing
4 changed files
with
87 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Release to SNAPSHOTS Maven Central | ||
|
||
env: | ||
MAVEN_ARGS: -B -C -V -ntp -Dhttp.keepAlive=false -e ${{ github.event.inputs.additional_args }} | ||
RELEASE_MAVEN_ARGS: -Prelease -Denforcer.skip=true | ||
OSSRHUSERNAME: ${{ secrets.OSSRHUSERNAME }} | ||
OSSRHPASSWORD: ${{ secrets.OSSRHPASSWORD }} | ||
SIGNINGPASSWORD: ${{ secrets.SIGNINGPASSWORD }} | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 2 * * *' # Every day at 2am | ||
|
||
jobs: | ||
release-snapshots: | ||
name: Release SNAPSHOT | ||
# Cheap way to prevent accidental releases | ||
# Modify the list to add users with release permissions | ||
if: contains('["rhuss","rohanKanojia"]', github.actor) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 11 | ||
distribution: temurin | ||
server-id: sonatype-nexus-snapshots | ||
server-username: OSSRHUSERNAME | ||
server-password: OSSRHPASSWORD | ||
gpg-private-key: ${{ secrets.SIGNINGKEY }} | ||
gpg-passphrase: SIGNINGPASSWORD | ||
- name: Build and Release Project | ||
run: ./mvnw ${MAVEN_ARGS} ${RELEASE_MAVEN_ARGS} clean deploy |
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# How to use Fabric8 docker-maven-plugin snapshot artifacts? | ||
|
||
Artifacts are hosted at [docker-maven-plugin's Sonatype Snapshot repository](https://oss.sonatype.org/content/repositories/snapshots/io/fabric8/docker-maven-plugin/) | ||
|
||
Our [GitHub Action Snapshot release workflow](https://github.com/fabric8io/docker-maven-plugin/blob/master/.github/workflows/release-snapshots.yml) updates SNAPSHOT artifacts every night. | ||
|
||
## Using SNAPSHOTs in Maven Project | ||
|
||
In order to use these artifacts, update your `pom.xml` with these: | ||
|
||
```xml | ||
<pluginRepositories> | ||
<pluginRepository> | ||
<id>oss.sonatype.org</id> | ||
<url>https://oss.sonatype.org/content/repositories/snapshots</url> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
<updatePolicy>always</updatePolicy> | ||
</snapshots> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
``` | ||
|
||
You'd also need to update version of the plugin you're using to use a SNAPSHOT version instead of a stable version. Here is an example: | ||
|
||
```xml | ||
<properties> | ||
<docker-maven-plugin.version>x.yz-SNAPSHOT</docker-maven-plugin.version> | ||
</properties> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>io.fabric8</groupId> | ||
<artifactId>docker-maven-plugin</artifactId> | ||
<version>${docker-maven-plugin.version}</version> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
``` | ||
|
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