Skip to content

Commit 866c06c

Browse files
authored
Merge pull request #115 from bci-oss/#114-release-milestones-to-github
#114 release milestones to GitHub
2 parents 0027b4a + 063d306 commit 866c06c

File tree

3 files changed

+69
-21
lines changed

3 files changed

+69
-21
lines changed

.github/workflows/release-workflow.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
release_version:
66
description: 'Version number of the release'
77
required: true
8+
milestone_version:
9+
description: '"true" if a milestone release shall be published'
10+
required: false
811
jobs:
912
build:
1013
runs-on: ubuntu-20.04
@@ -65,7 +68,10 @@ jobs:
6568
git push origin ${{ env.release_branch_name }}
6669
- name: Run tests and build
6770
run: mvn -B clean install
71+
72+
# release-build
6873
- name: Create GitHub release
74+
condition: eq( '${{ github.event.inputs.release_version }}', 'true')
6975
uses: softprops/action-gh-release@v1
7076
id: sds_sdk_release
7177
with:
@@ -79,8 +85,30 @@ jobs:
7985
env:
8086
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8187
- name: Publish to OSSRH
82-
run: mvn -B clean -pl '!sds-sdk-test-report,!tools/bamm-cli' deploy -DskipTests
88+
condition: eq( '${{ github.event.inputs.release_version }}', 'true')
89+
run: mvn -B clean -pl '!sds-sdk-test-report,!tools/bamm-cli' deploy -DskipTests -Prelease-build
8390
env:
8491
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
8592
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
8693
PGP_KEY_PASSWORD: ${{ secrets.PGP_KEY_PASSWORD }}
94+
95+
# milestone-build
96+
- name: Create GitHub release
97+
condition: ne( '${{ github.event.inputs.release_version }}', 'true')
98+
uses: softprops/action-gh-release@v1
99+
id: sds_sdk_release
100+
with:
101+
body: "Release of the BAMM SDK in version v${{ github.event.inputs.release_version }}."
102+
tag_name: v${{ github.event.inputs.release_version }}
103+
target_commitish: ${{ env.release_branch_name }}
104+
draft: false
105+
prerelease: true
106+
files: |
107+
**/target/*-${{ github.event.inputs.release_version }}.jar
108+
env:
109+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110+
- name: Publish to Github
111+
condition: ne( '${{ github.event.inputs.release_version }}', 'true')
112+
run: mvn -B clean -pl '!sds-sdk-test-report,!tools/bamm-cli' deploy -DskipTests -Pmilestone-build
113+
env:
114+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
- [Version Handling](#version-handling)
1414
- [BAMM Versioning](#bamm-versioning)
1515
- [BAMM Java Implementation Packaging](#bamm-java-implementation-packaging)
16-
- [API Versioning](#api-versioning)
1716
- [BAMM CLI](#bamm-cli)
1817
- [Artifact Generation facilities](#artifact-generation-facilities)
1918
- [POJO Generator](#pojo-generator)
@@ -113,6 +112,9 @@ manner, some changes cannot be carried out without the need to define a new, bre
113112
important to understand the versioning concept that is applied to the BAMM, APIs and SDK components that are derived
114113
from them.
115114

115+
In case of a prerelease there will be a postfix added and it will be released under Github.
116+
The way to access the artifact is described in [Github-Installing a package](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry#installing-a-package)
117+
116118
### BAMM Versioning
117119

118120
For the BAMM, semantic versioning (`major.minor.micro`) is applied with the following rules:

pom.xml

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@
344344
</dependency>
345345
</dependencies>
346346
</dependencyManagement>
347-
348347
<build>
349348
<pluginManagement>
350349
<plugins>
@@ -520,24 +519,43 @@
520519
</gpgArguments>
521520
</configuration>
522521
</plugin>
523-
<plugin>
524-
<groupId>org.sonatype.plugins</groupId>
525-
<artifactId>nexus-staging-maven-plugin</artifactId>
526-
<version>1.6.7</version>
527-
<extensions>true</extensions>
528-
<configuration>
529-
<serverId>ossrh</serverId>
530-
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
531-
<autoReleaseAfterClose>false</autoReleaseAfterClose>
532-
</configuration>
533-
</plugin>
534522
</plugins>
535523
</build>
536-
<distributionManagement>
537-
<repository>
538-
<id>ossrh</id>
539-
<name>OSSRH</name>
540-
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
541-
</repository>
542-
</distributionManagement>
524+
<profiles>
525+
<profile>
526+
<id>release-build</id>
527+
<distributionManagement>
528+
<repository>
529+
<id>ossrh</id>
530+
<name>OSSRH</name>
531+
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
532+
</repository>
533+
</distributionManagement>
534+
<build>
535+
<plugins>
536+
<plugin>
537+
<groupId>org.sonatype.plugins</groupId>
538+
<artifactId>nexus-staging-maven-plugin</artifactId>
539+
<version>1.6.7</version>
540+
<extensions>true</extensions>
541+
<configuration>
542+
<serverId>ossrh</serverId>
543+
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
544+
<autoReleaseAfterClose>false</autoReleaseAfterClose>
545+
</configuration>
546+
</plugin>
547+
</plugins>
548+
</build>
549+
</profile>
550+
<profile>
551+
<id>milestone-build</id>
552+
<distributionManagement>
553+
<repository>
554+
<id>github</id>
555+
<name>Github</name>
556+
<url>https://maven.pkg.github.com/OpenManufacturingPlatform/sds-sdk</url>
557+
</repository>
558+
</distributionManagement>
559+
</profile>
560+
</profiles>
543561
</project>

0 commit comments

Comments
 (0)