Skip to content

Commit

Permalink
Merge pull request #1 from ConnectorIO/feature/mavenized-artifacts
Browse files Browse the repository at this point in the history
Testing workflow execution
  • Loading branch information
splatch authored Apr 8, 2024
2 parents a72a374 + e1fedaa commit 6f90be3
Show file tree
Hide file tree
Showing 193 changed files with 224 additions and 566 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
distribution: 'temurin'
java-version: '21'
cache: gradle
server-id: 'https://oss.sonatype.org'
server-username: CI_DEPLOY_USERNAME
server-password: CI_DEPLOY_PASSWORD

- uses: kiancross/checkstyle-annotations-action@v1

Expand All @@ -34,7 +37,6 @@ jobs:
- name: Validate EdgeApp.bndrun
run: git diff --exit-code io.openems.edge.application/EdgeApp.bndrun

#
# Generate Code-coverage-report
#
- name: Generate JaCoCo Code-coverage-report
Expand Down Expand Up @@ -65,6 +67,14 @@ jobs:
mkdir -p ./jacoco
echo $PR_NUMBER > ./jacoco/jacoco_report_number
echo '![Code Coverage]'"(https://img.shields.io/badge/Code%20Coverage-${coverage}%25-${color}?style=flat)" > ./jacoco/jacoco_report_badge
- name: Deploy Edge+Backend assets
if: success() && github.event_name == 'push' && github.ref_name == 'develop'
run: ./gradlew buildEdge buildBackend release -DmavenPublishRepository=RemoteMavenRepository
env:
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}

- uses: actions/upload-artifact@v4
with:
name: jacoco_report
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ jobs:
distribution: 'temurin'
java-version: '21'
cache: gradle
server-id: 'https://oss.sonatype.org'
server-username: CI_RELEASE_USERNAME
server-password: CI_RELEASE_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}

- uses: kiancross/checkstyle-annotations-action@v1

Expand All @@ -32,8 +36,12 @@ jobs:
- name: Validate EdgeApp.bndrun
run: git diff --exit-code io.openems.edge.application/EdgeApp.bndrun

- name: Prepare Edge+Backend assets
run: ./gradlew buildEdge buildBackend
- name: Prepare and deploy Edge+Backend assets
run: ./gradlew buildEdge buildBackend release -DmavenPublishRepository=RemoteMavenRepository -Drelease=true
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
CI_RELEASE_USERNAME: ${{ secrets.CI_RELEASE_USERNAME }}
CI_RELEASE_PASSWORD: ${{ secrets.CI_RELEASE_PASSWORD }}

- name: Save build-artifacts
uses: actions/upload-artifact@v4
Expand Down
29 changes: 27 additions & 2 deletions cnf/build.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,22 @@
pretty = true; \
local = ${build}/release

-releaserepo: Release
-baselinerepo: Release

-pom: true
Bundle-Vendor: FENECON GmbH
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.SNAPSHOT

-include: ${if;${def;release};\
${.}/release.bnd;\
${.}/snapshot.bnd\
}

-releaserepo: Release,${def;mavenPublishRepository;RemoteMavenRepository,LocalMavenRepository}

# Reproducible build - do not put headers which insert build timestamp, other than we wish
-noextraheaders: true
-reproducible: true

# Always use contracts
-contract: *
Expand Down Expand Up @@ -78,3 +90,16 @@ testpath: \

javac.source: 17
javac.target: 17

_remoteMavenSnapshotRepository=${def;remoteMavenSnapshotRepository;https://oss.sonatype.org/content/repositories/snapshots/}
_remoteMavenReleaseRepository=${def;remoteMavenReleaseRepository;https://oss.sonatype.org/service/local/staging/deploy/maven2/}
-plugin.repositories.mavenRemote: \
aQute.bnd.repository.maven.provider.MavenBndRepository; \
name='RemoteMavenRepository'; \
snapshotUrl="${_remoteMavenSnapshotRepository}"; \
releaseUrl="${_remoteMavenReleaseRepository}"; \
noupdateOnRelease=true
-plugin.repositories.mavenLocal: \
aQute.bnd.repository.maven.provider.MavenBndRepository; \
name='MavenLocalRepository'; \
noupdateOnRelease=true
12 changes: 12 additions & 0 deletions cnf/release.bnd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
mavenRemoteRelease: remote, pom;path=JAR, sources, javadoc, \
${if;${is;${env;GPG_PASSPHRASE;UNSET};UNSET};;sign\\;passphrase="${first;${env;GPG_PASSPHRASE};DEFAULT}"}
# snapshot instruction must not be set, otherwise it causes bnd to deploy into snapshot repository
# -snapshot

# trigger maven deploy
-maven-release: ${if;${def;mavenPublishRepository};${mavenRemoteRelease}}

# trigger maven deploy
-pom: \
groupid=io.openems, \
version=${versionmask;===;${@version}}
9 changes: 9 additions & 0 deletions cnf/snapshot.bnd
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
mavenRemoteRelease: remote;${-snapshot}, pom;path=JAR, sources
-snapshot: ${tstamp}

# trigger maven deploy
-maven-release: ${if;${def;mavenPublishRepository};${mavenRemoteRelease}}

-pom: \
groupid=io.openems, \
version=${versionmask;===;${@version}}-SNAPSHOT
2 changes: 1 addition & 1 deletion doc/modules/ROOT/pages/edge/implement.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ io.openems.edge.meter.api::
Bundle-Name: OpenEMS Edge Meter Simulated
Bundle-Vendor: OpenEMS Association e.V.
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.${tstamp}
-buildpath: \
${buildpath},\
Expand Down
4 changes: 2 additions & 2 deletions doc/modules/ROOT/pages/i18n/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -3261,7 +3261,7 @@ msgid ""
"Bundle-Name: OpenEMS Edge Meter Simulated\n"
"Bundle-Vendor: OpenEMS Association e.V.\n"
"Bundle-License: https://opensource.org/licenses/EPL-2.0\n"
"Bundle-Version: 1.0.0.${tstamp}\n"
"\n"
"Export-Package: \\\n"
"\tio.openems.edge.meter.api,\\\n"
"\tio.openems.edge.meter.asymmetric.api,\\\n"
Expand All @@ -3271,7 +3271,7 @@ msgstr ""
"Bundle-Name: OpenEMS Edge Meter Simulated\n"
"Bundle-Vendor: OpenEMS Association e.V.\n"
"Bundle-License: https://opensource.org/licenses/EPL-2.0\n"
"Bundle-Version: 1.0.0.${tstamp}\n"
"\n"
"Export-Paket: \\\n"
"\tio.openems.edge.meter.api,\\\n"
"\tio.openems.edge.meter.asymmetric.api,\\\n"
Expand Down
2 changes: 1 addition & 1 deletion doc/modules/ROOT/pages/i18n/translate.pot
Original file line number Diff line number Diff line change
Expand Up @@ -3712,7 +3712,7 @@ msgid ""
"Bundle-Name: OpenEMS Edge Meter Simulated\n"
"Bundle-Vendor: OpenEMS Association e.V.\n"
"Bundle-License: https://opensource.org/licenses/EPL-2.0\n"
"Bundle-Version: 1.0.0.${tstamp}\n"
"\n"
"Export-Package: \\\n"
"\tio.openems.edge.meter.api,\\\n"
"\tio.openems.edge.meter.asymmetric.api,\\\n"
Expand Down
3 changes: 0 additions & 3 deletions io.openems.backend.alerting/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
Bundle-Name: OpenEMS Backend Alerting
Bundle-Vendor: FENECON GmbH
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.${tstamp}

-buildpath: \
${buildpath},\
Expand Down
3 changes: 0 additions & 3 deletions io.openems.backend.application/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
Bundle-Name: OpenEMS Backend
Bundle-Vendor: FENECON GmbH
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.${tstamp}

-buildpath: \
${buildpath},\
Expand Down
3 changes: 0 additions & 3 deletions io.openems.backend.b2brest/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
Bundle-Name: OpenEMS Backend-to-Backend REST-Api
Bundle-Vendor: FENECON GmbH
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.${tstamp}

-buildpath: \
${buildpath},\
Expand Down
3 changes: 0 additions & 3 deletions io.openems.backend.b2bwebsocket/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
Bundle-Name: OpenEMS Backend-to-Backend Websocket
Bundle-Vendor: FENECON GmbH
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.${tstamp}

-buildpath: \
${buildpath},\
Expand Down
5 changes: 1 addition & 4 deletions io.openems.backend.common/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
Bundle-Name: OpenEMS Backend Common
Bundle-Vendor: FENECON GmbH
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.${tstamp}

-buildpath: \
${buildpath},\
io.openems.common

-testpath: \
${testpath}
${testpath}
3 changes: 0 additions & 3 deletions io.openems.backend.core/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
Bundle-Name: OpenEMS Backend Core
Bundle-Vendor: FENECON GmbH
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.${tstamp}
Bundle-Description: Supportive services that are used throughout OpenEMS Backend

-buildpath: \
Expand Down
3 changes: 0 additions & 3 deletions io.openems.backend.edgewebsocket/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
Bundle-Name: OpenEMS Backend EdgeWebsocket Impl
Bundle-Vendor: FENECON GmbH
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.${tstamp}

-buildpath: \
${buildpath},\
Expand Down
3 changes: 0 additions & 3 deletions io.openems.backend.metadata.dummy/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
Bundle-Name: OpenEMS Backend Metadata Dummy
Bundle-Vendor: FENECON GmbH
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.${tstamp}

-buildpath: \
${buildpath},\
Expand Down
3 changes: 0 additions & 3 deletions io.openems.backend.metadata.file/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
Bundle-Name: OpenEMS Backend Metadata File
Bundle-Vendor: FENECON GmbH
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.${tstamp}

-buildpath: \
${buildpath},\
Expand Down
5 changes: 1 addition & 4 deletions io.openems.backend.metadata.odoo/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
Bundle-Name: OpenEMS Backend Odoo Impl
Bundle-Vendor: FENECON GmbH
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.${tstamp}

-buildpath: \
${buildpath},\
Expand All @@ -10,6 +7,6 @@ Bundle-Version: 1.0.0.${tstamp}
io.openems.common,\
io.openems.wrapper.aXMLRPC,\
org.postgresql.jdbc, \

-testpath: \
${testpath}
3 changes: 0 additions & 3 deletions io.openems.backend.timedata.aggregatedinflux/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
Bundle-Name: OpenEMS Backend Timedata Aggregated InfluxDB
Bundle-Vendor: FENECON GmbH
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.${tstamp}

-buildpath: \
${buildpath},\
Expand Down
3 changes: 0 additions & 3 deletions io.openems.backend.timedata.dummy/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
Bundle-Name: OpenEMS Backend Timedata Dummy
Bundle-Vendor: FENECON GmbH
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.${tstamp}

-buildpath: \
${buildpath},\
Expand Down
3 changes: 0 additions & 3 deletions io.openems.backend.timedata.influx/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
Bundle-Name: OpenEMS Backend Timedata InfluxDB
Bundle-Vendor: FENECON GmbH
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.${tstamp}

-buildpath: \
${buildpath},\
Expand Down
5 changes: 2 additions & 3 deletions io.openems.backend.timedata.timescaledb/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Bundle-Name: OpenEMS Backend Timedata TimescaleDB
Bundle-Vendor: FENECON GmbH
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.${tstamp}



-buildpath: \
${buildpath},\
Expand Down
5 changes: 2 additions & 3 deletions io.openems.backend.uiwebsocket/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Bundle-Name: OpenEMS Backend UiWebsocket Impl
Bundle-Vendor: FENECON GmbH
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.${tstamp}



-buildpath: \
${buildpath},\
Expand Down
3 changes: 0 additions & 3 deletions io.openems.common/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
Bundle-Name: OpenEMS Common
Bundle-Vendor: FENECON GmbH
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.${tstamp}

-buildpath: \
${buildpath},\
Expand Down
2 changes: 0 additions & 2 deletions io.openems.common/resources/templates/api/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
Bundle-Name: OpenEMS Edge $projectName$ Api
Bundle-Vendor: OpenEMS Association e.V.
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.\${tstamp}

-buildpath: \
\${buildpath},\
Expand Down
2 changes: 0 additions & 2 deletions io.openems.common/resources/templates/controller/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
Bundle-Name: OpenEMS Edge Controller $projectName$
Bundle-Vendor: OpenEMS Association e.V.
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.\${tstamp}

-buildpath: \
\${buildpath},\
Expand Down
2 changes: 0 additions & 2 deletions io.openems.common/resources/templates/device-modbus/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
Bundle-Name: OpenEMS Edge $projectName$
Bundle-Vendor: OpenEMS Association e.V.
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.\${tstamp}

-buildpath: \
\${buildpath},\
Expand Down
2 changes: 0 additions & 2 deletions io.openems.common/resources/templates/device/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
Bundle-Name: OpenEMS Edge $projectName$
Bundle-Vendor: OpenEMS Association e.V.
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.\${tstamp}

-buildpath: \
\${buildpath},\
Expand Down
4 changes: 0 additions & 4 deletions io.openems.edge.application/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
Bundle-Name: OpenEMS Edge
Bundle-Vendor: FENECON GmbH
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.${tstamp}

-buildpath: \
${buildpath},\
Expand All @@ -10,4 +7,3 @@ Bundle-Version: 1.0.0.${tstamp}

-testpath: \
${testpath}

3 changes: 0 additions & 3 deletions io.openems.edge.battery.api/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
Bundle-Name: OpenEMS Edge Battery Api
Bundle-Vendor: FENECON GmbH
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.${tstamp}

-buildpath: \
${buildpath},\
Expand Down
5 changes: 1 addition & 4 deletions io.openems.edge.battery.bmw/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
Bundle-Name: OpenEMS Edge BMW Battery
Bundle-Vendor: FENECON GmbH
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.${tstamp}

-buildpath: \
${buildpath},\
Expand All @@ -12,4 +9,4 @@ Bundle-Version: 1.0.0.${tstamp}
io.openems.edge.common

-testpath: \
${testpath}
${testpath}
5 changes: 1 addition & 4 deletions io.openems.edge.battery.bydcommercial/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
Bundle-Name: OpenEMS Edge BYD Battery-Box Commercial
Bundle-Vendor: FENECON GmbH
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.${tstamp}

-buildpath: \
${buildpath},\
Expand All @@ -13,4 +10,4 @@ Bundle-Version: 1.0.0.${tstamp}
io.openems.edge.ess.api

-testpath: \
${testpath}
${testpath}
5 changes: 2 additions & 3 deletions io.openems.edge.battery.fenecon.commercial/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Bundle-Name: OpenEMS Edge Battery FENECON Commercial
Bundle-Vendor: FENECON GmbH
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.${tstamp}



-buildpath: \
${buildpath},\
Expand Down
Loading

0 comments on commit 6f90be3

Please sign in to comment.