diff --git a/.github/workflows/nexus-dev.yml b/.github/workflows/nexus-dev.yml new file mode 100644 index 0000000000..14a9d01c8a --- /dev/null +++ b/.github/workflows/nexus-dev.yml @@ -0,0 +1,85 @@ +name: Build and push artifacts to nexus + +on: + push: + branches: + - develop + pull_request: + types: + - closed + +jobs: + build: + runs-on: macOS + environment: development + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: 14.17.3 + - name: Run Setup + run: npm run setup + - name: Install sanitize npm module + run: npm install sanitize-filename + - name: Copy electron-builder environment file + run: cp ~/actions-runner/envs/electron-builder.env packages/app/electron-builder.env + - name: Build App + 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 }} + ROLLBAR_TOKEN: ${{ secrets.ROLLBAR_TOKEN }} + 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_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 }} + MUDITA_CENTER_PRERELEASE_ENABLED: ${{ secrets.MUDITA_CENTER_PRERELEASE_ENABLED }} + run: | + printenv + exit 1 + cd packages/app/ && npm run dist:prod:all + - name: Push artifacts to nexus registry + env: + NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} + NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} + run: | + export SOURCE_BRANCH=${{ github.head_ref }} + if [[ -z $SOURCE_BRANCH ]]; then + export BRANCH_NAME="${GITHUB_REF#refs/heads/}" + if [[ $BRANCH_NAME == "develop" ]]; then + export "VERSION=dev.${{ github.run_number }}" + else + export "VERSION=.${{ github.run_number }}" + fi + else + export BRANCH_NAME=$SOURCE_BRANCH + if [[ $BRANCH_NAME == "develop" ]]; then + export "VERSION=dev.${{ github.run_number }}" + else + export "VERSION=.${{ github.run_number }}" + fi + fi + export APP_VERSION=`echo -n v && cat packages/app/package.json | jq -r .version` + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.exe https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/Mudita-Center.exe + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.AppImage https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/Mudita-Center.AppImage + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.dmg https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/Mudita-Center.dmg + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.zip https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/Mudita-Center.zip + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.zip.blockmap https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/Mudita-Center.zip.blockmap + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.exe.blockmap https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/Mudita-Center.exe.blockmap + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.dmg.blockmap https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/Mudita-Center.dmg.blockmap + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/latest-linux.yml https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/latest-linux.yml + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/latest-mac.yml https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/latest-mac.yml + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/latest.yml https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/latest.yml + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/builder-debug.yml https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/builder-debug.yml + diff --git a/.github/workflows/nexus-production.yml b/.github/workflows/nexus-production.yml new file mode 100644 index 0000000000..72e5db1409 --- /dev/null +++ b/.github/workflows/nexus-production.yml @@ -0,0 +1,82 @@ +name: Build and push artifacts to nexus + +on: + push: + branches: + - main + +jobs: + build: + runs-on: macOS + environment: production + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: 14.17.3 + - name: Run Setup + run: npm run setup + - name: Install sanitize npm module + run: npm install sanitize-filename + - name: Copy electron-builder environment file + run: cp ~/actions-runner/envs/electron-builder.env packages/app/electron-builder.env + - name: Build App + 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 }} + ROLLBAR_TOKEN: ${{ secrets.ROLLBAR_TOKEN }} + 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_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 }} + MUDITA_CENTER_PRERELEASE_ENABLED: ${{ secrets.MUDITA_CENTER_PRERELEASE_ENABLED }} + run: | + printenv + exit 1 + cd packages/app/ && npm run dist:prod:all + - name: Push artifacts to nexus registry + env: + NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} + NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} + run: | + export SOURCE_BRANCH=${{ github.head_ref }} + if [[ -z $SOURCE_BRANCH ]]; then + export BRANCH_NAME="${GITHUB_REF#refs/heads/}" + if [[ $BRANCH_NAME == "develop" ]]; then + export "VERSION=dev.${{ github.run_number }}" + else + export "VERSION=.${{ github.run_number }}" + fi + else + export BRANCH_NAME=$SOURCE_BRANCH + if [[ $BRANCH_NAME == "develop" ]]; then + export "VERSION=dev.${{ github.run_number }}" + else + export "VERSION=.${{ github.run_number }}" + fi + fi + export APP_VERSION=`echo -n v && cat packages/app/package.json | jq -r .version` + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.exe https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/Mudita-Center.exe + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.AppImage https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/Mudita-Center.AppImage + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.dmg https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/Mudita-Center.dmg + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.zip https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/Mudita-Center.zip + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.zip.blockmap https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/Mudita-Center.zip.blockmap + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.exe.blockmap https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/Mudita-Center.exe.blockmap + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.dmg.blockmap https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/Mudita-Center.dmg.blockmap + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/latest-linux.yml https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/latest-linux.yml + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/latest-mac.yml https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/latest-mac.yml + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/latest.yml https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/latest.yml + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/builder-debug.yml https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/builder-debug.yml + diff --git a/.github/workflows/nexus-staging.yml b/.github/workflows/nexus-staging.yml new file mode 100644 index 0000000000..07300c4c94 --- /dev/null +++ b/.github/workflows/nexus-staging.yml @@ -0,0 +1,82 @@ +name: Build and push artifacts to nexus + +on: + push: + branches: + - stage + - v* +jobs: + build: + runs-on: macOS + environment: pre-production + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: 14.17.3 + - name: Run Setup + run: npm run setup + - name: Install sanitize npm module + run: npm install sanitize-filename + - name: Copy electron-builder environment file + run: cp ~/actions-runner/envs/electron-builder.env packages/app/electron-builder.env + - name: Build App + 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 }} + ROLLBAR_TOKEN: ${{ secrets.ROLLBAR_TOKEN }} + 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_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 }} + MUDITA_CENTER_PRERELEASE_ENABLED: ${{ secrets.MUDITA_CENTER_PRERELEASE_ENABLED }} + run: | + printenv + exit 1 + cd packages/app/ && npm run dist:prod:all + - name: Push artifacts to nexus registry + env: + NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} + NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} + run: | + export SOURCE_BRANCH=${{ github.head_ref }} + if [[ -z $SOURCE_BRANCH ]]; then + export BRANCH_NAME="${GITHUB_REF#refs/heads/}" + if [[ $BRANCH_NAME == "develop" ]]; then + export "VERSION=dev.${{ github.run_number }}" + else + export "VERSION=.${{ github.run_number }}" + fi + else + export BRANCH_NAME=$SOURCE_BRANCH + if [[ $BRANCH_NAME == "develop" ]]; then + export "VERSION=dev.${{ github.run_number }}" + else + export "VERSION=.${{ github.run_number }}" + fi + fi + export APP_VERSION=`echo -n v && cat packages/app/package.json | jq -r .version` + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.exe https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/Mudita-Center.exe + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.AppImage https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/Mudita-Center.AppImage + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.dmg https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/Mudita-Center.dmg + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.zip https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/Mudita-Center.zip + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.zip.blockmap https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/Mudita-Center.zip.blockmap + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.exe.blockmap https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/Mudita-Center.exe.blockmap + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.dmg.blockmap https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/Mudita-Center.dmg.blockmap + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/latest-linux.yml https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/latest-linux.yml + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/latest-mac.yml https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/latest-mac.yml + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/latest.yml https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/latest.yml + curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/builder-debug.yml https://nexus.mudita.com/repository/mudita-center/releases/$BRANCH_NAME/$APP_VERSION-$VERSION/builder-debug.yml +