Skip to content

Merge pull request #208 from SoftwareAG/develop #80

Merge pull request #208 from SoftwareAG/develop

Merge pull request #208 from SoftwareAG/develop #80

Workflow file for this run

# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Build Mapper
on:
workflow_dispatch:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 11
distribution: zulu
- name: Build MQTT Service Backend
run: mvn -B package --file pom.xml
- name: Rename cumulocity file
run: |
mv ./dynamic-mapping-service/src/main/configuration/cumulocity-without-mqttservice.json ./dynamic-mapping-service/src/main/configuration/cumulocity.json
- name: Rename file
run: mv ./dynamic-mapping-service/target/dynamic-mapping-service.zip ./dynamic-mapping-service/target/dynamic-mapping-service-for-mqtt-service.zip
- name: Build Backend
run: mvn -B package --file pom.xml
working-directory: ./
- name: Rename file
run: |
mv ./dynamic-mapping-service/target/dynamic-mapping-service.zip ./dynamic-mapping-service/target/dynamic-mapping-service-without-mqtt-service.zip
mv ./dynamic-mapping-service/target/dynamic-mapping-service-for-mqtt-service.zip ./dynamic-mapping-service/target/dynamic-mapping-service.zip
- name: deploy
uses: actions/setup-node@v2
with:
node-version: 18.x
- run: npm i
working-directory: ./dynamic-mapping-ui
- run: npm install -g @angular/cli > /dev/null
working-directory: ./dynamic-mapping-ui
- run: npm run build --if-present
working-directory: ./dynamic-mapping-ui
- name: Zip Frontend Plugin
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
run: |
cd dynamic-mapping-ui/dist/dynamic-mapping
zip -r -q ../../dynamic-mapping.zip *
- name: Create Release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
- name: Upload Release Asset Frontend Blueprint
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
id: upload-release-asset-frontend
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./dynamic-mapping-ui/dynamic-mapping.zip
asset_name: dynamic-mapping.zip
asset_content_type: application/zip
- name: Upload Release Asset Backend
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./dynamic-mapping-service/target/dynamic-mapping-service.zip
asset_name: dynamic-mapping-service.zip
asset_content_type: application/zip
- name: Upload Release Asset Backend
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
id: upload-release-asset-mqtt-service
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./dynamic-mapping-service/target/dynamic-mapping-service-without-mqtt-service.zip
asset_name: dynamic-mapping-service-without-mqtt-service.zip
asset_content_type: application/zip