Skip to content

Commit 6757d25

Browse files
authored
Feature/publish initial state (#1)
* Initial Contribution
1 parent 9e22190 commit 6757d25

File tree

946 files changed

+127802
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

946 files changed

+127802
-2
lines changed

.editorconfig

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#
2+
# Copyright (c) 2022 Robert Bosch Manufacturing Solutions GmbH
3+
#
4+
# See the AUTHORS file(s) distributed with this work for
5+
# additional information regarding authorship.
6+
#
7+
# This Source Code Form is subject to the terms of the Mozilla Public
8+
# License, v. 2.0. If a copy of the MPL was not distributed with this
9+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
10+
#
11+
# SPDX-License-Identifier: MPL-2.0
12+
#
13+
14+
# Editor configuration, see http://editorconfig.org
15+
root = true
16+
17+
[*]
18+
charset = utf-8
19+
indent_style = space
20+
indent_size = 2
21+
insert_final_newline = true
22+
trim_trailing_whitespace = true
23+
24+
[*.md]
25+
max_line_length = off
26+
trim_trailing_whitespace = false
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Bug report
3+
about: Create a bug report to help us improve.
4+
title: "[BUG]"
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**Where**
14+
Indicate the location of the bug (e.g., which component of the Aspect Model Editor, which API call, which command etc.).
15+
16+
**Screenshots**
17+
If applicable, add screenshots to help explain your problem.
18+
19+
20+
**Additional context**
21+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: false
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Task
3+
about: Suggest a task for this project. This can be any type of work item like for example a feature request.
4+
title: '[Task]'
5+
labels: task
6+
assignees: ''
7+
8+
---
9+
10+
**Is your task related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Examples are "I am always frustrated when [...]", or "I think it is cumbersome to [...]", "There seems to be a better way to [...]"
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you have considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Check New Pull Request
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ '**' ]
8+
9+
# Tests are done in Ubuntu because Mac and Windows random failures, and it is not stable.
10+
jobs:
11+
build:
12+
name: Check if passes all requirements
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout project
17+
uses: actions/checkout@v3
18+
19+
- name: Cache node modules
20+
uses: actions/cache@v3
21+
env:
22+
cache-name: cache-node-modules
23+
with:
24+
path: ~/.npm
25+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
26+
restore-keys: |
27+
${{ runner.os }}-build-${{ env.cache-name }}-
28+
${{ runner.os }}-build-
29+
${{ runner.os }}-
30+
31+
- name: Setup NodeJs
32+
uses: actions/setup-node@v3
33+
with:
34+
node-version: '17'
35+
cache: 'npm'
36+
cache-dependency-path: '**/package-lock.json'
37+
38+
- name: Install node modules (Dev)
39+
run: npm install
40+
working-directory: core
41+
42+
- name: Identifying and reporting lint patterns
43+
run: npm run lint
44+
working-directory: core
45+
46+
- name: Performing jest tests
47+
run: npm run test
48+
working-directory: core
49+
50+
- name: Performing cypress tests
51+
run: npm run cypress:ci
52+
working-directory: core
53+
54+
- name: Build dev package
55+
run: npm run build
56+
working-directory: core
Lines changed: 224 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
name: "Create Tagged Release"
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
gh_tagged_release:
10+
name: Create tagged release
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ macos-latest, windows-latest, ubuntu-latest ]
15+
16+
steps:
17+
- name: Checkout project
18+
uses: actions/checkout@v3
19+
20+
- name: Cache node modules
21+
uses: actions/cache@v3
22+
env:
23+
cache-name: cache-node-modules
24+
with:
25+
path: ~/.npm
26+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
27+
restore-keys: |
28+
${{ runner.os }}-build-${{ env.cache-name }}-
29+
${{ runner.os }}-build-
30+
${{ runner.os }}-
31+
32+
- name: Setup NodeJs
33+
uses: actions/setup-node@v3
34+
with:
35+
node-version: '17'
36+
cache: 'npm'
37+
cache-dependency-path: '**/package-lock.json'
38+
39+
- name: Set tag version (Unix)
40+
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'
41+
run: echo "tagVersion=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
42+
43+
- name: Set tag version (Windows)
44+
if: matrix.os == 'windows-latest'
45+
run: |
46+
$version = $env:GITHUB_REF.replace('refs/tags/v','')
47+
echo "tagVersion=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf-8 -Append
48+
49+
- name: Download aspect model service into project (Mac)
50+
if: matrix.os == 'macos-latest'
51+
run: |
52+
mkdir backend
53+
54+
ASSET_ONE_URL=$(curl -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/OpenManufacturingPlatform/sds-aspect-model-editor-backend/releases/tags/v$tagVersion | jq '.assets[0].browser_download_url')
55+
ASSET_TWO_URL=$(curl -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/OpenManufacturingPlatform/sds-aspect-model-editor-backend/releases/tags/v$tagVersion | jq '.assets[1].browser_download_url')
56+
ASSET_THREE_URL=$(curl -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/OpenManufacturingPlatform/sds-aspect-model-editor-backend/releases/tags/v$tagVersion | jq '.assets[2].browser_download_url')
57+
58+
if [[ ${ASSET_ONE_URL} == *"-mac"* ]];
59+
then
60+
echo $ASSET_ONE_URL
61+
DOWNLOAD_URL=$(curl -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/OpenManufacturingPlatform/sds-aspect-model-editor-backend/releases/tags/v$tagVersion | jq -r '.assets[0].url')
62+
fi
63+
64+
if [[ ${ASSET_TWO_URL} == *"-mac"* ]];
65+
then
66+
echo $ASSET_TWO_URL
67+
DOWNLOAD_URL=$(curl -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/OpenManufacturingPlatform/sds-aspect-model-editor-backend/releases/tags/v$tagVersion | jq -r '.assets[1].url')
68+
fi
69+
70+
if [[ ${ASSET_THREE_URL} == *"-mac"* ]];
71+
then
72+
echo ASSET_THREE_URL
73+
DOWNLOAD_URL=$(curl -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/OpenManufacturingPlatform/sds-aspect-model-editor-backend/releases/tags/v$tagVersion | jq -r '.assets[2].url')
74+
fi
75+
76+
curl -L -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/octet-stream" $DOWNLOAD_URL > backend/ame-backend.sh
77+
chmod 755 backend/ame-backend.sh
78+
79+
- name: Download aspect model service into project (Linux)
80+
if: matrix.os == 'ubuntu-latest'
81+
run: |
82+
mkdir backend
83+
84+
ASSET_ONE_URL=$(curl -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/OpenManufacturingPlatform/sds-aspect-model-editor-backend/releases/tags/v$tagVersion | jq '.assets[0].browser_download_url')
85+
ASSET_TWO_URL=$(curl -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/OpenManufacturingPlatform/sds-aspect-model-editor-backend/releases/tags/v$tagVersion | jq '.assets[1].browser_download_url')
86+
ASSET_THREE_URL=$(curl -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/OpenManufacturingPlatform/sds-aspect-model-editor-backend/releases/tags/v$tagVersion | jq '.assets[2].browser_download_url')
87+
88+
if [[ ${ASSET_ONE_URL} == *"-linux"* ]];
89+
then
90+
echo $ASSET_ONE_URL
91+
DOWNLOAD_URL=$(curl -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/OpenManufacturingPlatform/sds-aspect-model-editor-backend/releases/tags/v$tagVersion | jq -r '.assets[0].url')
92+
fi
93+
94+
if [[ ${ASSET_TWO_URL} == *"-linux"* ]];
95+
then
96+
echo $ASSET_TWO_URL
97+
DOWNLOAD_URL=$(curl -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/OpenManufacturingPlatform/sds-aspect-model-editor-backend/releases/tags/v$tagVersion | jq -r '.assets[1].url')
98+
fi
99+
100+
if [[ ${ASSET_THREE_URL} == *"-linux"* ]];
101+
then
102+
echo ASSET_THREE_URL
103+
DOWNLOAD_URL=$(curl -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/OpenManufacturingPlatform/sds-aspect-model-editor-backend/releases/tags/v$tagVersion | jq -r '.assets[2].url')
104+
fi
105+
106+
curl -L -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/octet-stream" $DOWNLOAD_URL > backend/ame-backend.sh
107+
chmod 755 backend/ame-backend.sh
108+
109+
- name: Download aspect model service into project (Windows)
110+
if: matrix.os == 'windows-latest'
111+
run: |
112+
mkdir backend
113+
114+
$RESPONSE=$(curl.exe -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/OpenManufacturingPlatform/sds-aspect-model-editor-backend/releases/tags/v$env:tagVersion)
115+
$RESPONSE_JSON=($RESPONSE | ConvertFrom-Json)
116+
117+
if ($RESPONSE_JSON.assets[0].browser_download_url -match ".exe") {
118+
echo $RESPONSE_JSON.assets[0].browser_download_url
119+
curl.exe -sL -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/octet-stream" $RESPONSE_JSON.assets[0].url -o backend/ame-backend.exe
120+
} elseif ($RESPONSE_JSON.assets[1].browser_download_url -match ".exe") {
121+
echo $RESPONSE_JSON.assets[1].browser_download_url
122+
curl.exe -sL -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/octet-stream" $RESPONSE_JSON.assets[1].url -o backend/ame-backend.exe
123+
} elseif ($RESPONSE_JSON.assets[2].browser_download_url -match ".exe") {
124+
echo $RESPONSE_JSON.assets[2].browser_download_url
125+
curl.exe -sL -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/octet-stream" $RESPONSE_JSON.assets[2].url -o backend/ame-backend.exe
126+
}
127+
128+
129+
- name: Install node modules
130+
run: npm install
131+
working-directory: core
132+
133+
- name: Set app version (Unix)
134+
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'
135+
run: npm version $tagVersion
136+
working-directory: core
137+
138+
- name: Set app version (Windows)
139+
if: matrix.os == 'windows-latest'
140+
run: npm version $env:tagVersion
141+
working-directory: core
142+
143+
- name: Build electron app (Mac)
144+
if: matrix.os == 'macos-latest'
145+
run: npm run electron-builder-mac-prod
146+
working-directory: core
147+
148+
- name: Build electron app (Linux)
149+
if: matrix.os == 'ubuntu-latest'
150+
run: npm run electron-builder-linux-prod
151+
working-directory: core
152+
153+
- name: Build electron app (Windows)
154+
if: matrix.os == 'windows-latest'
155+
run: npm run electron-builder-win-prod
156+
working-directory: core
157+
158+
- name: Create Windows installer
159+
if: matrix.os == 'windows-latest'
160+
uses: joncloud/[email protected]
161+
with:
162+
script-file: win-installer/installer.nsi
163+
arguments: "-V3 -DVERSION=${{ env.tagVersion }}"
164+
165+
- name: Create GitHub release (Mac)
166+
if: ${{ (matrix.os == 'macos-latest') && (!contains( github.ref, '-M' )) }}
167+
uses: svenstaro/upload-release-action@latest
168+
with:
169+
overwrite: true
170+
prerelease: false
171+
repo_token: ${{ secrets.GITHUB_TOKEN }}
172+
file: core/electron/aspect-model-editor-v${{ env.tagVersion }}-mac.dmg
173+
tag: ${{ github.ref }}
174+
175+
- name: Create GitHub pre-release (Mac)
176+
if: ${{ (matrix.os == 'macos-latest') && (contains( github.ref, '-M' )) }}
177+
uses: svenstaro/upload-release-action@latest
178+
with:
179+
overwrite: true
180+
prerelease: true
181+
repo_token: ${{ secrets.GITHUB_TOKEN }}
182+
file: core/electron/aspect-model-editor-v${{ env.tagVersion }}-mac.dmg
183+
tag: ${{ github.ref }}
184+
185+
- name: Create GitHub release (Linux)
186+
if: ${{ (matrix.os == 'ubuntu-latest') && (!contains( github.ref, '-M' )) }}
187+
uses: svenstaro/upload-release-action@latest
188+
with:
189+
overwrite: true
190+
prerelease: false
191+
repo_token: ${{ secrets.GITHUB_TOKEN }}
192+
file: core/electron/aspect-model-editor-v${{ env.tagVersion }}-linux.tar.gz
193+
tag: ${{ github.ref }}
194+
195+
- name: Create GitHub pre-release (Linux)
196+
if: ${{ (matrix.os == 'ubuntu-latest') && (contains( github.ref, '-M' )) }}
197+
uses: svenstaro/upload-release-action@latest
198+
with:
199+
overwrite: true
200+
prerelease: true
201+
repo_token: ${{ secrets.GITHUB_TOKEN }}
202+
file: core/electron/aspect-model-editor-v${{ env.tagVersion }}-linux.tar.gz
203+
tag: ${{ github.ref }}
204+
205+
- name: Create GitHub release (Windows)
206+
if: ${{ (matrix.os == 'windows-latest') && (!contains( github.ref, '-M' )) }}
207+
uses: svenstaro/upload-release-action@latest
208+
with:
209+
overwrite: true
210+
prerelease: false
211+
repo_token: ${{ secrets.GITHUB_TOKEN }}
212+
file: win-installer/aspect-model-editor-v${{ env.tagVersion }}-win.exe
213+
tag: ${{ github.ref }}
214+
215+
- name: Create GitHub pre-release (Windows)
216+
if: ${{ (matrix.os == 'windows-latest') && (contains( github.ref, '-M' )) }}
217+
uses: svenstaro/upload-release-action@latest
218+
with:
219+
overwrite: true
220+
prerelease: true
221+
repo_token: ${{ secrets.GITHUB_TOKEN }}
222+
file: win-installer/aspect-model-editor-v${{ env.tagVersion }}-win.exe
223+
tag: ${{ github.ref }}
224+

0 commit comments

Comments
 (0)