Improved serialport implementation #3319
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & deploy to feature branch | |
on: | |
push: | |
branches: | |
- CP-* | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [Linux, macOS, Windows] | |
environment: development | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.18.1 | |
- name: Setup Env for Windows | |
if: matrix.os == 'Windows' | |
env: | |
E2ECI: "false" | |
PHRASE_API_KEY: ${{ secrets.PHRASE_API_KEY }} | |
PHRASE_API_URL: ${{ secrets.PHRASE_API_URL }} | |
PHRASE_API_KEY_DEV: ${{ secrets.PHRASE_API_KEY_DEV }} | |
MUDITA_CENTER_SERVER_URL: ${{ secrets.MUDITA_CENTER_SERVER_URL }} | |
MUDITA_CENTER_SERVER_V2_URL: ${{ secrets.MUDITA_CENTER_SERVER_V2_URL }} | |
ROLLBAR_TOKEN: ${{ secrets.ROLLBAR_TOKEN }} | |
RELEASES_REPOSITORY_NAME: ${{ secrets.RELEASES_REPOSITORY_NAME }} | |
PRERELEASES_ENABLED: ${{ secrets.PRERELEASES_ENABLED }} | |
GITHUB_ACCESS_TOKEN: ${{ secrets.MC_GITHUB_ACCESS_TOKEN }} | |
LOGIN_MICROSOFT_ONLINE_CLIENT_ID: ${{ secrets.LOGIN_MICROSOFT_ONLINE_CLIENT_ID }} | |
FONTS_DIRECTORY_URL: ${{ secrets.FONTS_DIRECTORY_URL }} | |
FRESHDESK_API_URL: ${{ secrets.FRESHDESK_API_URL }} | |
FRESHDESK_API_TOKEN: ${{ secrets.FRESHDESK_API_TOKEN }} | |
ANALYTICS_ENABLED: ${{ secrets.ANALYTICS_ENABLED }} | |
ANALYTICS_API_URL: ${{ secrets.ANALYTICS_API_URL }} | |
ANALYTICS_API_SITE_ID: ${{ secrets.ANALYTICS_API_SITE_ID }} | |
FEATURE_TOGGLE_ENVIRONMENT: ${{ secrets.FEATURE_TOGGLE_ENVIRONMENT }} | |
STATIC_CONFIGURATION_FILE_PATH: ${{ secrets.STATIC_CONFIGURATION_FILE_PATH }} | |
DEV_REDUX_LOGGER_ENABLED: ${{ secrets.DEV_REDUX_LOGGER_ENABLED }} | |
DEV_DEVICE_LOGGER_ENABLED: ${{ secrets.DEV_DEVICE_LOGGER_ENABLED }} | |
FEATURE_TOGGLE_RELEASE_ENVIRONMENT: ${{ secrets.FEATURE_TOGGLE_RELEASE_ENVIRONMENT }} | |
DEV_TOOLS_SHORTCUT_ENABLED: "1" | |
LOCALAPPDATA: "" | |
NX_NO_CLOUD: true | |
shell: cmd | |
run: | | |
SET > .env | |
jq -r -j .version apps/app/package.json > apps/app/version | |
- name: Setup Env for Mac | |
if: matrix.os == 'macOS' | |
env: | |
PHRASE_API_KEY: ${{ secrets.PHRASE_API_KEY }} | |
PHRASE_API_URL: ${{ secrets.PHRASE_API_URL }} | |
PHRASE_API_KEY_DEV: ${{ secrets.PHRASE_API_KEY_DEV }} | |
MUDITA_CENTER_SERVER_URL: ${{ secrets.MUDITA_CENTER_SERVER_URL }} | |
MUDITA_CENTER_SERVER_V2_URL: ${{ secrets.MUDITA_CENTER_SERVER_V2_URL }} | |
ROLLBAR_TOKEN: ${{ secrets.ROLLBAR_TOKEN }} | |
RELEASES_REPOSITORY_NAME: ${{ secrets.RELEASES_REPOSITORY_NAME }} | |
PRERELEASES_ENABLED: ${{ secrets.PRERELEASES_ENABLED }} | |
GITHUB_ACCESS_TOKEN: ${{ secrets.MC_GITHUB_ACCESS_TOKEN }} | |
LOGIN_MICROSOFT_ONLINE_CLIENT_ID: ${{ secrets.LOGIN_MICROSOFT_ONLINE_CLIENT_ID }} | |
FONTS_DIRECTORY_URL: ${{ secrets.FONTS_DIRECTORY_URL }} | |
FRESHDESK_API_URL: ${{ secrets.FRESHDESK_API_URL }} | |
FRESHDESK_API_TOKEN: ${{ secrets.FRESHDESK_API_TOKEN }} | |
ANALYTICS_ENABLED: ${{ secrets.ANALYTICS_ENABLED }} | |
ANALYTICS_API_URL: ${{ secrets.ANALYTICS_API_URL }} | |
ANALYTICS_API_SITE_ID: ${{ secrets.ANALYTICS_API_SITE_ID }} | |
FEATURE_TOGGLE_ENVIRONMENT: ${{ secrets.FEATURE_TOGGLE_ENVIRONMENT }} | |
STATIC_CONFIGURATION_FILE_PATH: ${{ secrets.STATIC_CONFIGURATION_FILE_PATH }} | |
DEV_REDUX_LOGGER_ENABLED: ${{ secrets.DEV_REDUX_LOGGER_ENABLED }} | |
DEV_DEVICE_LOGGER_ENABLED: ${{ secrets.DEV_DEVICE_LOGGER_ENABLED }} | |
FEATURE_TOGGLE_RELEASE_ENVIRONMENT: ${{ secrets.FEATURE_TOGGLE_RELEASE_ENVIRONMENT }} | |
DEV_TOOLS_SHORTCUT_ENABLED: "1" | |
CI: true | |
NX_NO_CLOUD: true | |
run: | | |
printenv > .env | |
- name: Setup Env for Linux | |
if: matrix.os == 'Linux' | |
env: | |
PHRASE_API_KEY: ${{ secrets.PHRASE_API_KEY }} | |
PHRASE_API_URL: ${{ secrets.PHRASE_API_URL }} | |
PHRASE_API_KEY_DEV: ${{ secrets.PHRASE_API_KEY_DEV }} | |
MUDITA_CENTER_SERVER_URL: ${{ secrets.MUDITA_CENTER_SERVER_URL }} | |
MUDITA_CENTER_SERVER_V2_URL: ${{ secrets.MUDITA_CENTER_SERVER_V2_URL }} | |
ROLLBAR_TOKEN: ${{ secrets.ROLLBAR_TOKEN }} | |
RELEASES_REPOSITORY_NAME: ${{ secrets.RELEASES_REPOSITORY_NAME }} | |
PRERELEASES_ENABLED: ${{ secrets.PRERELEASES_ENABLED }} | |
GITHUB_ACCESS_TOKEN: ${{ secrets.MC_GITHUB_ACCESS_TOKEN }} | |
LOGIN_MICROSOFT_ONLINE_CLIENT_ID: ${{ secrets.LOGIN_MICROSOFT_ONLINE_CLIENT_ID }} | |
FONTS_DIRECTORY_URL: ${{ secrets.FONTS_DIRECTORY_URL }} | |
FRESHDESK_API_URL: ${{ secrets.FRESHDESK_API_URL }} | |
FRESHDESK_API_TOKEN: ${{ secrets.FRESHDESK_API_TOKEN }} | |
ANALYTICS_ENABLED: ${{ secrets.ANALYTICS_ENABLED }} | |
ANALYTICS_API_URL: ${{ secrets.ANALYTICS_API_URL }} | |
ANALYTICS_API_SITE_ID: ${{ secrets.ANALYTICS_API_SITE_ID }} | |
FEATURE_TOGGLE_ENVIRONMENT: ${{ secrets.FEATURE_TOGGLE_ENVIRONMENT }} | |
STATIC_CONFIGURATION_FILE_PATH: ${{ secrets.STATIC_CONFIGURATION_FILE_PATH }} | |
DEV_REDUX_LOGGER_ENABLED: ${{ secrets.DEV_REDUX_LOGGER_ENABLED }} | |
DEV_DEVICE_LOGGER_ENABLED: ${{ secrets.DEV_DEVICE_LOGGER_ENABLED }} | |
FEATURE_TOGGLE_RELEASE_ENVIRONMENT: ${{ secrets.FEATURE_TOGGLE_RELEASE_ENVIRONMENT }} | |
DEV_TOOLS_SHORTCUT_ENABLED: "1" | |
NX_NO_CLOUD: true | |
run: | | |
printenv > .env | |
- name: Changing app version in packages.json for Linux | |
if: matrix.os == 'Linux' | |
run: | | |
export APP_VERSION=`cat apps/app/package.json | jq -r .version` | |
export SOURCE_BRANCH=${{ github.ref_name }} | |
export "ENVIRONMENT_CATALOG_NAME=feature-branch/${{ github.ref_name }}" | |
export "BUILD_VERSION=-dev.${{ github.run_number }}" | |
sed -i "s/\"version\": \".*\",/\"version\": \"$APP_VERSION$BUILD_VERSION\",/" apps/app/package.json | |
- name: Changing app version in packages.json for Mac | |
if: matrix.os == 'macOS' | |
run: | | |
export APP_VERSION=`cat apps/app/package.json | jq -r .version` | |
export SOURCE_BRANCH=${{ github.ref_name }} | |
export "ENVIRONMENT_CATALOG_NAME=feature-branch/${{ github.ref_name }}" | |
export "BUILD_VERSION=-dev.${{ github.run_number }}" | |
sed -i '' "s/\"version\": \".*\",/\"version\": \"$APP_VERSION$BUILD_VERSION\",/" apps/app/package.json | |
- name: Changing app version in packages.json for Windows | |
if: matrix.os == 'Windows' | |
run: | | |
$SOURCE_BRANCH = "${{ github.ref_name }}" | |
$ENVIRONMENT_CATALOG_NAME = "feature-branch/${{ github.ref_name }}" | |
$BUILD_VERSION = "-dev.${{ github.run_number }}" | |
$APP_VERSION = (Get-Content -Path "apps/app/version") + $BUILD_VERSION | |
(Get-Content -Path 'apps/app/package.json') | ForEach-Object { | |
$_ -replace '"version": ".*",' , "`"version`"`: `"$APP_VERSION`"," | |
} | Set-Content -Path 'apps/app/package.json' | |
- name: Setup dependencies | |
run: npm run setup | |
# - name: Install additional dependencies for Linux & Mac | |
# if: matrix.os != 'Windows' | |
# run: pip install setuptools | |
- name: Copy electron-builder environment file for Linux/Mac | |
if: matrix.os != 'Windows' | |
run: | | |
cp ~/actions-runner/envs/electron-builder.env apps/app/electron-builder.env | |
- name: Build App for Windows | |
if: matrix.os == 'Windows' | |
run: | | |
$env:NODE_OPTIONS="--max-old-space-size=4096" | |
$env:LOCALAPPDATA="" | |
npx nx build:win app --output-style stream --no-cloud | |
- name: Build App for Mac | |
if: matrix.os == 'macOS' | |
run: | | |
export NODE_OPTIONS="--max-old-space-size=4096" | |
npx nx build:mac app --universal --output-style stream --no-cloud | |
- name: Build App for Linux | |
if: matrix.os == 'Linux' | |
run: | | |
export NODE_OPTIONS="--max-old-space-size=4096" | |
npx nx build:linux app --output-style stream --no-cloud | |
- name: Verify apple sign | |
if: matrix.os == 'macOS' | |
run: | | |
ls -la ./apps/app/release | |
codesign -v -v apps/app/release/mac-universal/Mudita\ Center.app | |
- name: Push artifacts to nexus registry from Windows | |
if: matrix.os == 'Windows' | |
env: | |
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} | |
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} | |
run: | | |
jq -r -j .version apps/app/package.json > apps/app/version | |
$APP_VERSION = Get-Content -Path "apps/app/version" | |
$SOURCE_BRANCH = "${{ github.ref_name }}" | |
$ENVIRONMENT_CATALOG_NAME = "feature-branch/${{ github.ref_name }}" | |
$NEXUS_USERNAME = "$env:NEXUS_USERNAME" | |
$NEXUS_PASSWORD = ConvertTo-SecureString "$env:NEXUS_PASSWORD" -AsPlainText -Force | |
$AUTH = New-Object System.Management.Automation.PSCredential ($NEXUS_USERNAME, $NEXUS_PASSWORD) | |
Invoke-WebRequest -Uri https://nexus.mudita.com/repository/mudita-center/releases/$ENVIRONMENT_CATALOG_NAME/$($APP_VERSION)/Mudita-Center.exe -InFile ./apps/app/release/Mudita-Center.exe -Method Put -Credential $AUTH | |
Invoke-WebRequest -Uri https://nexus.mudita.com/repository/mudita-center/releases/$ENVIRONMENT_CATALOG_NAME/$($APP_VERSION)/Mudita-Center.exe.blockmap -InFile ./apps/app/release/Mudita-Center.exe.blockmap -Method Put -Credential $AUTH | |
Invoke-WebRequest -Uri https://nexus.mudita.com/repository/mudita-center/releases/$ENVIRONMENT_CATALOG_NAME/$($APP_VERSION)/dev.yml -InFile ./apps/app/release/dev.yml -Method Put -Credential $AUTH | |
Invoke-WebRequest -Uri https://nexus.mudita.com/repository/mudita-center/releases/$ENVIRONMENT_CATALOG_NAME/$($APP_VERSION)/builder-debug-win.yml -InFile ./apps/app/release/builder-debug.yml -Method Put -Credential $AUTH | |
- name: Push artifacts to nexus registry from Linux | |
if: matrix.os == 'Linux' | |
env: | |
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} | |
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} | |
run: | | |
export APP_VERSION=`cat apps/app/package.json | jq -r .version` | |
export SOURCE_BRANCH=${{ github.ref_name }} | |
export "ENVIRONMENT_CATALOG_NAME=feature-branch/${{ github.ref_name }}" | |
curl -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./apps/app/release/Mudita-Center.AppImage https://nexus.mudita.com/repository/mudita-center/releases/$ENVIRONMENT_CATALOG_NAME/$APP_VERSION/Mudita-Center.AppImage | |
curl -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./apps/app/release/dev-linux.yml https://nexus.mudita.com/repository/mudita-center/releases/$ENVIRONMENT_CATALOG_NAME/$APP_VERSION/dev-linux.yml | |
curl -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./apps/app/release/builder-debug.yml https://nexus.mudita.com/repository/mudita-center/releases/$ENVIRONMENT_CATALOG_NAME/$APP_VERSION/builder-debug-linux.yml | |
- name: Push artifacts to nexus registry from macOS | |
if: matrix.os == 'macOS' | |
env: | |
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} | |
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} | |
run: | | |
export APP_VERSION=`cat apps/app/package.json | jq -r .version` | |
export SOURCE_BRANCH=${{ github.ref_name }} | |
export "ENVIRONMENT_CATALOG_NAME=feature-branch/${{ github.ref_name }}" | |
curl -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./apps/app/release/Mudita-Center.dmg https://nexus.mudita.com/repository/mudita-center/releases/$ENVIRONMENT_CATALOG_NAME/$APP_VERSION/Mudita-Center.dmg | |
curl -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./apps/app/release/Mudita-Center.zip https://nexus.mudita.com/repository/mudita-center/releases/$ENVIRONMENT_CATALOG_NAME/$APP_VERSION/Mudita-Center.zip | |
curl -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./apps/app/release/Mudita-Center.zip.blockmap https://nexus.mudita.com/repository/mudita-center/releases/$ENVIRONMENT_CATALOG_NAME/$APP_VERSION/Mudita-Center.zip.blockmap | |
curl -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./apps/app/release/Mudita-Center.dmg.blockmap https://nexus.mudita.com/repository/mudita-center/releases/$ENVIRONMENT_CATALOG_NAME/$APP_VERSION/Mudita-Center.dmg.blockmap | |
curl -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./apps/app/release/dev-mac.yml https://nexus.mudita.com/repository/mudita-center/releases/$ENVIRONMENT_CATALOG_NAME/$APP_VERSION/dev-mac.yml | |
curl -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./apps/app/release/builder-debug.yml https://nexus.mudita.com/repository/mudita-center/releases/$ENVIRONMENT_CATALOG_NAME/$APP_VERSION/builder-debug-mac.yml |