-
Notifications
You must be signed in to change notification settings - Fork 9
105 lines (99 loc) · 5.12 KB
/
build-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# 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