From 1174138daa6e5a8e9653b6cb2c10daab0ff56b29 Mon Sep 17 00:00:00 2001 From: Jagandeep Brar Date: Wed, 11 May 2022 19:20:40 -0400 Subject: [PATCH] chore(ci): include VERSION.txt for each platform in S3 [skip ci] --- .github/workflows/notify.yml | 108 ++++++++++++++ .github/workflows/prepare.yml | 12 +- .github/workflows/publish_android.yml | 58 ++++++++ .github/workflows/publish_ios.yml | 58 ++++++++ .github/workflows/publish_linux.yml | 58 ++++++++ .github/workflows/publish_macos.yml | 64 ++++++++ .github/workflows/publish_s3.yml | 205 -------------------------- .github/workflows/publish_web.yml | 58 ++++++++ .github/workflows/publish_windows.yml | 78 ++++++++++ .github/workflows/release.yml | 190 +++++++++++++++--------- 10 files changed, 607 insertions(+), 282 deletions(-) create mode 100644 .github/workflows/notify.yml delete mode 100644 .github/workflows/publish_s3.yml create mode 100644 .github/workflows/publish_windows.yml diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml new file mode 100644 index 00000000..1bdc21d3 --- /dev/null +++ b/.github/workflows/notify.yml @@ -0,0 +1,108 @@ +name: Notify + +on: + workflow_call: + inputs: + build-title: + required: true + type: string + flavor: + required: true + type: string + enable-android: + required: true + type: string + enable-ios: + required: true + type: string + enable-linux: + required: true + type: string + enable-macos: + required: true + type: string + enable-web: + required: true + type: string + enable-windows: + required: true + type: string + + secrets: + DISCORD_WEBHOOK_EDGE: + required: true + DISCORD_WEBHOOK_BETA: + required: true + DISCORD_WEBHOOK_CANDIDATE: + required: true + DISCORD_WEBHOOK_STABLE: + required: true + +jobs: + discord: + name: Discord + runs-on: ubuntu-latest + steps: + - name: Determine Webhook Channel + id: webhook + uses: actions/github-script@v6 + env: + DISCORD_WEBHOOK_EDGE: ${{ secrets.DISCORD_WEBHOOK_EDGE }} + DISCORD_WEBHOOK_BETA: ${{ secrets.DISCORD_WEBHOOK_BETA }} + DISCORD_WEBHOOK_CANDIDATE: ${{ secrets.DISCORD_WEBHOOK_CANDIDATE }} + DISCORD_WEBHOOK_STABLE: ${{ secrets.DISCORD_WEBHOOK_STABLE }} + FLAVOR: ${{ inputs.flavor }} + with: + result-encoding: string + script: | + const ref = process.env.FLAVOR || 'edge'; + switch (ref) { + case 'beta': return process.env.DISCORD_WEBHOOK_BETA; + case 'candidate': return process.env.DISCORD_WEBHOOK_CANDIDATE; + case 'stable': return process.env.DISCORD_WEBHOOK_STABLE; + case 'edge': + default: return process.env.DISCORD_WEBHOOK_EDGE; + } + + - name: Create Discord Message + id: message + uses: actions/github-script@v6 + env: + BUILD_TITLE: ${{ inputs.build-title }} + ANDROID: ${{ inputs.enable-android }} + IOS: ${{ inputs.enable-ios }} + LINUX: ${{ inputs.enable-linux }} + MACOS: ${{ inputs.enable-macos }} + WEB: ${{ inputs.enable-web }} + WINDOWS: ${{ inputs.enable-windows }} + with: + result-encoding: string + script: | + const { ANDROID, IOS, LINUX, MACOS, WEB, WINDOWS } = process.env; + const url = `https://builds.lunasea.app/#${ process.env.BUILD_TITLE }/`; + let _base = `[Download](${url})`; + if ( ANDROID || IOS || LINUX || MACOS || WEB || WINDOWS) { + _base += '\n\nThis release is available on the following platforms: '; + + const platforms = []; + if (ANDROID === 'true') platforms.push('Android'); + if (IOS === 'true') platforms.push('iOS'); + if (LINUX === 'true') platforms.push('Linux'); + if (MACOS === 'true') platforms.push('macOS'); + if (WEB === 'true') platforms.push('Web'); + if (WINDOWS === 'true') platforms.push('Windows'); + + _base += platforms.map((p) => `**${p}**`).join(', '); + } + return _base; + + - name: Send Discord Message + uses: sarisia/actions-status-discord@v1 + with: + webhook: ${{ steps.webhook.outputs.result }} + username: LunaSea Support + avatar_url: https://raw.githubusercontent.com/JagandeepBrar/LunaSea/master/assets/icon/icon.png + noprefix: true + color: 0x4ECCA3 + title: ${{ inputs.build-title }} + description: ${{ steps.message.outputs.result }} diff --git a/.github/workflows/prepare.yml b/.github/workflows/prepare.yml index 21f3df2e..6a6c1602 100644 --- a/.github/workflows/prepare.yml +++ b/.github/workflows/prepare.yml @@ -71,7 +71,7 @@ jobs: with: result-encoding: string script: | - if (process.env.EXISTS == "false") return true; + if (process.env.EXISTS === "false") return true; return process.env.MESSAGE.includes("platform:android"); - name: iOS @@ -83,7 +83,7 @@ jobs: with: result-encoding: string script: | - if (process.env.EXISTS == "false") return true; + if (process.env.EXISTS === "false") return true; return process.env.MESSAGE.includes("platform:ios"); - name: Linux @@ -95,7 +95,7 @@ jobs: with: result-encoding: string script: | - if (process.env.EXISTS == "false") return true; + if (process.env.EXISTS === "false") return true; return process.env.MESSAGE.includes("platform:linux"); - name: macOS @@ -107,7 +107,7 @@ jobs: with: result-encoding: string script: | - if (process.env.EXISTS == "false") return true; + if (process.env.EXISTS === "false") return true; return process.env.MESSAGE.includes("platform:macos"); - name: Web @@ -119,7 +119,7 @@ jobs: with: result-encoding: string script: | - if (process.env.EXISTS == "false") return true; + if (process.env.EXISTS === "false") return true; return process.env.MESSAGE.includes("platform:web"); - name: Windows @@ -131,7 +131,7 @@ jobs: with: result-encoding: string script: | - if (process.env.EXISTS == "false") return true; + if (process.env.EXISTS === "false") return true; return process.env.MESSAGE.includes("platform:windows"); - name: Log Platform List diff --git a/.github/workflows/publish_android.yml b/.github/workflows/publish_android.yml index 2aaa12a5..dde9b275 100644 --- a/.github/workflows/publish_android.yml +++ b/.github/workflows/publish_android.yml @@ -3,6 +3,9 @@ name: Publish Android on: workflow_call: inputs: + build-number: + required: true + type: string build-title: required: true type: string @@ -13,6 +16,16 @@ on: secrets: GOOGLE_PLAY_API: required: true + S3_ACCESS_KEY: + required: true + S3_BUCKET: + required: true + S3_ENDPOINT: + required: true + S3_KEY_ID: + required: true + S3_REGION: + required: true jobs: play-store: @@ -53,3 +66,48 @@ jobs: env: SUPPLY_JSON_KEY: ${{ github.workspace }}/keys/googleplay.json run: bundle exec fastlane deploy_playstore track:${{ steps.channel.outputs.result }} aab:${{ github.workspace }}/output/lunasea-android.aab version_name:${{ inputs.build-title }} + + s3: + name: S3 + runs-on: ubuntu-latest + steps: + - name: Setup Environment + uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_deployment@master + with: + channel: s3 + + - name: Download Android App Package + uses: actions/download-artifact@v3 + with: + name: android-app-package + path: ${{ github.workspace }}/output + + - name: Upload to S3 Bucket (Build Title) + uses: jakejarvis/s3-sync-action@v0.5.1 + with: + args: --acl public-read --follow-symlinks + env: + AWS_ACCESS_KEY_ID: ${{ secrets.S3_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} + AWS_S3_BUCKET: ${{ secrets.S3_BUCKET }} + AWS_S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} + AWS_REGION: ${{ secrets.S3_REGION }} + SOURCE_DIR: ${{ github.workspace }}/output + DEST_DIR: ${{ inputs.build-title }} + + - name: Create Version File + working-directory: ${{ github.workspace }}/output + run: echo ${{ inputs.build-title }} > VERSION_ANDROID.txt + + - name: Upload to S3 Bucket (Latest) + uses: jakejarvis/s3-sync-action@v0.5.1 + with: + args: --acl public-read --follow-symlinks + env: + AWS_ACCESS_KEY_ID: ${{ secrets.S3_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} + AWS_S3_BUCKET: ${{ secrets.S3_BUCKET }} + AWS_S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} + AWS_REGION: ${{ secrets.S3_REGION }} + SOURCE_DIR: ${{ github.workspace }}/output + DEST_DIR: latest/${{ inputs.flavor }} diff --git a/.github/workflows/publish_ios.yml b/.github/workflows/publish_ios.yml index 748f3066..10fac78d 100644 --- a/.github/workflows/publish_ios.yml +++ b/.github/workflows/publish_ios.yml @@ -3,6 +3,9 @@ name: Publish iOS on: workflow_call: inputs: + build-number: + required: true + type: string build-title: required: true type: string @@ -23,6 +26,16 @@ on: required: true APPLE_TEAM_ID: required: true + S3_ACCESS_KEY: + required: true + S3_BUCKET: + required: true + S3_ENDPOINT: + required: true + S3_KEY_ID: + required: true + S3_REGION: + required: true jobs: app-store: @@ -51,3 +64,48 @@ jobs: APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} run: bundle exec fastlane deploy_appstore groups:${{ inputs.flavor }} ipa:${{ github.workspace }}/output/lunasea-ios.ipa + + s3: + name: S3 + runs-on: ubuntu-latest + steps: + - name: Setup Environment + uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_deployment@master + with: + channel: s3 + + - name: Download iOS App Package + uses: actions/download-artifact@v3 + with: + name: ios-appstore-package + path: ${{ github.workspace }}/output + + - name: Upload to S3 Bucket (Build Title) + uses: jakejarvis/s3-sync-action@v0.5.1 + with: + args: --acl public-read --follow-symlinks + env: + AWS_ACCESS_KEY_ID: ${{ secrets.S3_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} + AWS_S3_BUCKET: ${{ secrets.S3_BUCKET }} + AWS_S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} + AWS_REGION: ${{ secrets.S3_REGION }} + SOURCE_DIR: ${{ github.workspace }}/output + DEST_DIR: ${{ inputs.build-title }} + + - name: Create Version File + working-directory: ${{ github.workspace }}/output + run: echo ${{ inputs.build-title }} > VERSION_IOS.txt + + - name: Upload to S3 Bucket (Latest) + uses: jakejarvis/s3-sync-action@v0.5.1 + with: + args: --acl public-read --follow-symlinks + env: + AWS_ACCESS_KEY_ID: ${{ secrets.S3_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} + AWS_S3_BUCKET: ${{ secrets.S3_BUCKET }} + AWS_S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} + AWS_REGION: ${{ secrets.S3_REGION }} + SOURCE_DIR: ${{ github.workspace }}/output + DEST_DIR: latest/${{ inputs.flavor }} diff --git a/.github/workflows/publish_linux.yml b/.github/workflows/publish_linux.yml index b751b62f..cd178192 100644 --- a/.github/workflows/publish_linux.yml +++ b/.github/workflows/publish_linux.yml @@ -3,6 +3,9 @@ name: Publish Linux on: workflow_call: inputs: + build-number: + required: true + type: string build-title: required: true type: string @@ -13,6 +16,16 @@ on: secrets: SNAPCRAFT_TOKEN: required: true + S3_ACCESS_KEY: + required: true + S3_BUCKET: + required: true + S3_ENDPOINT: + required: true + S3_KEY_ID: + required: true + S3_REGION: + required: true jobs: snapcraft: @@ -33,3 +46,48 @@ jobs: - name: Deploy to Snapcraft run: snapcraft upload --release=${{ inputs.flavor }} ${{ github.workspace }}/output/lunasea-linux-amd64.snap + + s3: + name: S3 + runs-on: ubuntu-latest + steps: + - name: Setup Environment + uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_deployment@master + with: + channel: s3 + + - name: Download Linux Snap + uses: actions/download-artifact@v3 + with: + name: linux-snapcraft + path: ${{ github.workspace }}/output + + - name: Upload to S3 Bucket (Build Title) + uses: jakejarvis/s3-sync-action@v0.5.1 + with: + args: --acl public-read --follow-symlinks + env: + AWS_ACCESS_KEY_ID: ${{ secrets.S3_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} + AWS_S3_BUCKET: ${{ secrets.S3_BUCKET }} + AWS_S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} + AWS_REGION: ${{ secrets.S3_REGION }} + SOURCE_DIR: ${{ github.workspace }}/output + DEST_DIR: ${{ inputs.build-title }} + + - name: Create Version File + working-directory: ${{ github.workspace }}/output + run: echo ${{ inputs.build-title }} > VERSION_LINUX.txt + + - name: Upload to S3 Bucket (Latest) + uses: jakejarvis/s3-sync-action@v0.5.1 + with: + args: --acl public-read --follow-symlinks + env: + AWS_ACCESS_KEY_ID: ${{ secrets.S3_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} + AWS_S3_BUCKET: ${{ secrets.S3_BUCKET }} + AWS_S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} + AWS_REGION: ${{ secrets.S3_REGION }} + SOURCE_DIR: ${{ github.workspace }}/output + DEST_DIR: latest/${{ inputs.flavor }} diff --git a/.github/workflows/publish_macos.yml b/.github/workflows/publish_macos.yml index fa703d56..a624d7df 100644 --- a/.github/workflows/publish_macos.yml +++ b/.github/workflows/publish_macos.yml @@ -3,6 +3,9 @@ name: Publish macOS on: workflow_call: inputs: + build-number: + required: true + type: string build-title: required: true type: string @@ -23,6 +26,16 @@ on: required: true APPLE_TEAM_ID: required: true + S3_ACCESS_KEY: + required: true + S3_BUCKET: + required: true + S3_ENDPOINT: + required: true + S3_KEY_ID: + required: true + S3_REGION: + required: true jobs: app-store: @@ -51,3 +64,54 @@ jobs: APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} run: bundle exec fastlane deploy_appstore groups:${{ inputs.flavor }} pkg:${{ github.workspace }}/output/lunasea-macos-amd64.pkg + + s3: + name: S3 + runs-on: ubuntu-latest + steps: + - name: Setup Environment + uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_deployment@master + with: + channel: s3 + + - name: Download macOS App Package + uses: actions/download-artifact@v3 + with: + name: macos-app-package + path: ${{ github.workspace }}/output + + - name: Download macOS Disk Image + uses: actions/download-artifact@v3 + with: + name: macos-disk-image + path: ${{ github.workspace }}/output + + - name: Upload to S3 Bucket (Build Title) + uses: jakejarvis/s3-sync-action@v0.5.1 + with: + args: --acl public-read --follow-symlinks + env: + AWS_ACCESS_KEY_ID: ${{ secrets.S3_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} + AWS_S3_BUCKET: ${{ secrets.S3_BUCKET }} + AWS_S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} + AWS_REGION: ${{ secrets.S3_REGION }} + SOURCE_DIR: ${{ github.workspace }}/output + DEST_DIR: ${{ inputs.build-title }} + + - name: Create Version File + working-directory: ${{ github.workspace }}/output + run: echo ${{ inputs.build-title }} > VERSION_MACOS.txt + + - name: Upload to S3 Bucket (Latest) + uses: jakejarvis/s3-sync-action@v0.5.1 + with: + args: --acl public-read --follow-symlinks + env: + AWS_ACCESS_KEY_ID: ${{ secrets.S3_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} + AWS_S3_BUCKET: ${{ secrets.S3_BUCKET }} + AWS_S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} + AWS_REGION: ${{ secrets.S3_REGION }} + SOURCE_DIR: ${{ github.workspace }}/output + DEST_DIR: latest/${{ inputs.flavor }} diff --git a/.github/workflows/publish_s3.yml b/.github/workflows/publish_s3.yml deleted file mode 100644 index 5e1a1758..00000000 --- a/.github/workflows/publish_s3.yml +++ /dev/null @@ -1,205 +0,0 @@ -name: Publish S3 - -on: - workflow_call: - inputs: - build-title: - required: true - type: string - flavor: - required: true - type: string - enable-android: - required: true - type: string - enable-ios: - required: true - type: string - enable-linux: - required: true - type: string - enable-macos: - required: true - type: string - enable-web: - required: true - type: string - enable-windows: - required: true - type: string - - secrets: - DISCORD_WEBHOOK_EDGE: - required: true - DISCORD_WEBHOOK_BETA: - required: true - DISCORD_WEBHOOK_CANDIDATE: - required: true - DISCORD_WEBHOOK_STABLE: - required: true - S3_ACCESS_KEY: - required: true - S3_BUCKET: - required: true - S3_ENDPOINT: - required: true - S3_KEY_ID: - required: true - S3_REGION: - required: true - -jobs: - s3: - name: S3 - runs-on: ubuntu-latest - steps: - - name: Setup Environment - uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_deployment@master - with: - channel: s3 - - - name: Download Android App Package - uses: actions/download-artifact@v3 - continue-on-error: true - with: - name: android-app-package - path: ${{ github.workspace }}/output - - - name: Download iOS App Package - uses: actions/download-artifact@v3 - continue-on-error: true - with: - name: ios-appstore-package - path: ${{ github.workspace }}/output - - - name: Download Linux Snap - uses: actions/download-artifact@v3 - continue-on-error: true - with: - name: linux-snapcraft - path: ${{ github.workspace }}/output - - - name: Download macOS App Package - uses: actions/download-artifact@v3 - continue-on-error: true - with: - name: macos-app-package - path: ${{ github.workspace }}/output - - - name: Download macOS Disk Image - uses: actions/download-artifact@v3 - continue-on-error: true - with: - name: macos-disk-image - path: ${{ github.workspace }}/output - - - name: Download Windows App Package - uses: actions/download-artifact@v3 - continue-on-error: true - with: - name: windows-app-package - path: ${{ github.workspace }}/output - - - name: Download Web Archive - uses: actions/download-artifact@v3 - continue-on-error: true - with: - name: web-archive - path: ${{ github.workspace }}/output - - - name: Download Windows MSIX Installer - uses: actions/download-artifact@v3 - continue-on-error: true - with: - name: windows-msix-installer - path: ${{ github.workspace }}/output - - - name: Upload to S3 Bucket (Build Title) - uses: jakejarvis/s3-sync-action@v0.5.1 - with: - args: --acl public-read --follow-symlinks - env: - AWS_ACCESS_KEY_ID: ${{ secrets.S3_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} - AWS_S3_BUCKET: ${{ secrets.S3_BUCKET }} - AWS_S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} - AWS_REGION: ${{ secrets.S3_REGION }} - SOURCE_DIR: ${{ github.workspace }}/output - DEST_DIR: ${{ inputs.build-title }} - - - name: Upload to S3 Bucket (Latest) - uses: jakejarvis/s3-sync-action@v0.5.1 - with: - args: --acl public-read --follow-symlinks - env: - AWS_ACCESS_KEY_ID: ${{ secrets.S3_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} - AWS_S3_BUCKET: ${{ secrets.S3_BUCKET }} - AWS_S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} - AWS_REGION: ${{ secrets.S3_REGION }} - SOURCE_DIR: ${{ github.workspace }}/output - DEST_DIR: latest/${{ inputs.flavor }} - - - name: Determine Webhook Channel - id: webhook - uses: actions/github-script@v6 - env: - DISCORD_WEBHOOK_EDGE: ${{ secrets.DISCORD_WEBHOOK_EDGE }} - DISCORD_WEBHOOK_BETA: ${{ secrets.DISCORD_WEBHOOK_BETA }} - DISCORD_WEBHOOK_CANDIDATE: ${{ secrets.DISCORD_WEBHOOK_CANDIDATE }} - DISCORD_WEBHOOK_STABLE: ${{ secrets.DISCORD_WEBHOOK_STABLE }} - FLAVOR: ${{ inputs.flavor }} - with: - result-encoding: string - script: | - const ref = process.env.FLAVOR || 'edge'; - switch (ref) { - case 'beta': return process.env.DISCORD_WEBHOOK_BETA; - case 'candidate': return process.env.DISCORD_WEBHOOK_CANDIDATE; - case 'stable': return process.env.DISCORD_WEBHOOK_STABLE; - case 'edge': - default: return process.env.DISCORD_WEBHOOK_EDGE; - } - - - name: Create Discord Message - id: message - uses: actions/github-script@v6 - env: - BUILD_TITLE: ${{ inputs.build-title }} - ANDROID: ${{ inputs.enable-android }} - IOS: ${{ inputs.enable-ios }} - LINUX: ${{ inputs.enable-linux }} - MACOS: ${{ inputs.enable-macos }} - WEB: ${{ inputs.enable-web }} - WINDOWS: ${{ inputs.enable-windows }} - with: - result-encoding: string - script: | - const { ANDROID, IOS, LINUX, MACOS, WEB, WINDOWS } = process.env; - const url = `https://builds.lunasea.app/#${ process.env.BUILD_TITLE }/`; - let _base = `[Download](${url})`; - if ( ANDROID || IOS || LINUX || MACOS || WEB || WINDOWS) { - _base += '\n\nThis release is available on the following platforms: '; - - const platforms = []; - if (ANDROID) platforms.push('Android'); - if (IOS) platforms.push('iOS'); - if (LINUX) platforms.push('Linux'); - if (MACOS) platforms.push('macOS'); - if (WEB) platforms.push('Web'); - if (WINDOWS) platforms.push('Windows'); - - _base += platforms.map((p) => `**${p}**`).join(', '); - } - return _base; - - - name: Send Discord Message - uses: sarisia/actions-status-discord@v1 - with: - webhook: ${{ steps.webhook.outputs.result }} - username: LunaSea Support - avatar_url: https://raw.githubusercontent.com/JagandeepBrar/LunaSea/master/assets/icon/icon.png - noprefix: true - color: 0x4ECCA3 - title: ${{ inputs.build-title }} - description: ${{ steps.message.outputs.result }} diff --git a/.github/workflows/publish_web.yml b/.github/workflows/publish_web.yml index 98e21756..eb1c9349 100644 --- a/.github/workflows/publish_web.yml +++ b/.github/workflows/publish_web.yml @@ -3,6 +3,9 @@ name: Publish Web (Docker) on: workflow_call: inputs: + build-number: + required: true + type: string build-title: required: true type: string @@ -13,6 +16,16 @@ on: secrets: NETLIFY_AUTH_TOKEN: required: true + S3_ACCESS_KEY: + required: true + S3_BUCKET: + required: true + S3_ENDPOINT: + required: true + S3_KEY_ID: + required: true + S3_REGION: + required: true jobs: docker: @@ -81,3 +94,48 @@ jobs: publish-dir: ${{ github.workspace}}/output production-deploy: true deploy-message: ${{ inputs.build-title }} + + s3: + name: S3 + runs-on: ubuntu-latest + steps: + - name: Setup Environment + uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_deployment@master + with: + channel: s3 + + - name: Download Web Archive + uses: actions/download-artifact@v3 + with: + name: web-archive + path: ${{ github.workspace }}/output + + - name: Upload to S3 Bucket (Build Title) + uses: jakejarvis/s3-sync-action@v0.5.1 + with: + args: --acl public-read --follow-symlinks + env: + AWS_ACCESS_KEY_ID: ${{ secrets.S3_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} + AWS_S3_BUCKET: ${{ secrets.S3_BUCKET }} + AWS_S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} + AWS_REGION: ${{ secrets.S3_REGION }} + SOURCE_DIR: ${{ github.workspace }}/output + DEST_DIR: ${{ inputs.build-title }} + + - name: Create Version File + working-directory: ${{ github.workspace }}/output + run: echo ${{ inputs.build-title }} > VERSION_WEB.txt + + - name: Upload to S3 Bucket (Latest) + uses: jakejarvis/s3-sync-action@v0.5.1 + with: + args: --acl public-read --follow-symlinks + env: + AWS_ACCESS_KEY_ID: ${{ secrets.S3_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} + AWS_S3_BUCKET: ${{ secrets.S3_BUCKET }} + AWS_S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} + AWS_REGION: ${{ secrets.S3_REGION }} + SOURCE_DIR: ${{ github.workspace }}/output + DEST_DIR: latest/${{ inputs.flavor }} diff --git a/.github/workflows/publish_windows.yml b/.github/workflows/publish_windows.yml new file mode 100644 index 00000000..a1bf47a3 --- /dev/null +++ b/.github/workflows/publish_windows.yml @@ -0,0 +1,78 @@ +name: Publish Windows + +on: + workflow_call: + inputs: + build-number: + required: true + type: string + build-title: + required: true + type: string + flavor: + required: true + type: string + + secrets: + S3_ACCESS_KEY: + required: true + S3_BUCKET: + required: true + S3_ENDPOINT: + required: true + S3_KEY_ID: + required: true + S3_REGION: + required: true + +jobs: + s3: + name: S3 + runs-on: ubuntu-latest + steps: + - name: Setup Environment + uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_deployment@master + with: + channel: s3 + + - name: Download Windows App Package + uses: actions/download-artifact@v3 + with: + name: windows-app-package + path: ${{ github.workspace }}/output + + - name: Download Windows MSIX Installer + uses: actions/download-artifact@v3 + with: + name: windows-msix-installer + path: ${{ github.workspace }}/output + + - name: Upload to S3 Bucket (Build Title) + uses: jakejarvis/s3-sync-action@v0.5.1 + with: + args: --acl public-read --follow-symlinks + env: + AWS_ACCESS_KEY_ID: ${{ secrets.S3_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} + AWS_S3_BUCKET: ${{ secrets.S3_BUCKET }} + AWS_S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} + AWS_REGION: ${{ secrets.S3_REGION }} + SOURCE_DIR: ${{ github.workspace }}/output + DEST_DIR: ${{ inputs.build-title }} + + - name: Create Version File + working-directory: ${{ github.workspace }}/output + run: echo ${{ inputs.build-title }} > VERSION_WINDOWS.txt + + - name: Upload to S3 Bucket (Latest) + uses: jakejarvis/s3-sync-action@v0.5.1 + with: + args: --acl public-read --follow-symlinks + env: + AWS_ACCESS_KEY_ID: ${{ secrets.S3_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} + AWS_S3_BUCKET: ${{ secrets.S3_BUCKET }} + AWS_S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} + AWS_REGION: ${{ secrets.S3_REGION }} + SOURCE_DIR: ${{ github.workspace }}/output + DEST_DIR: latest/${{ inputs.flavor }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 267ad7d1..a163f354 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -114,87 +114,135 @@ jobs: CODE_SIGNING_PUBLISHER: ${{ secrets.CODE_SIGNING_PUBLISHER }} CODE_SIGNING_PUBLISHER_NAME: ${{ secrets.CODE_SIGNING_PUBLISHER_NAME }} - publish_android: + publish-android: name: Publish Android needs: [ prepare, build-android ] uses: JagandeepBrar/LunaSea/.github/workflows/publish_android.yml@master with: flavor: ${{ github.event.inputs.flavor || 'edge' }} + build-number: ${{ needs.prepare.outputs.build-number }} build-title: ${{ needs.prepare.outputs.build-title }} secrets: GOOGLE_PLAY_API: ${{ secrets.GOOGLE_PLAY_API }} - - publish_ios: - name: Publish iOS - needs: [ prepare, build-ios ] - uses: JagandeepBrar/LunaSea/.github/workflows/publish_ios.yml@master - with: - flavor: ${{ github.event.inputs.flavor || 'edge' }} - build-title: ${{ needs.prepare.outputs.build-title }} - secrets: - APPLE_ID: ${{ secrets.APPLE_ID }} - APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }} - APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }} - APPLE_STORE_CONNECT_KEY: ${{ secrets.APPLE_STORE_CONNECT_KEY }} - APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} - APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} - - publish_linux: - name: Publish Linux - needs: [ prepare, build-linux ] - uses: JagandeepBrar/LunaSea/.github/workflows/publish_linux.yml@master - with: - flavor: ${{ github.event.inputs.flavor || 'edge' }} - build-title: ${{ needs.prepare.outputs.build-title }} - secrets: - SNAPCRAFT_TOKEN: ${{ secrets.SNAPCRAFT_TOKEN }} - - publish_macos: - name: Publish macOS - needs: [ prepare, build-macos ] - uses: JagandeepBrar/LunaSea/.github/workflows/publish_macos.yml@master - with: - flavor: ${{ github.event.inputs.flavor || 'edge' }} - build-title: ${{ needs.prepare.outputs.build-title }} - secrets: - APPLE_ID: ${{ secrets.APPLE_ID }} - APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }} - APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }} - APPLE_STORE_CONNECT_KEY: ${{ secrets.APPLE_STORE_CONNECT_KEY }} - APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} - APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} - - publish_web: - name: Publish Web - needs: [ prepare, build-web ] - uses: JagandeepBrar/LunaSea/.github/workflows/publish_web.yml@master - with: - flavor: ${{ github.event.inputs.flavor || 'edge' }} - build-title: ${{ needs.prepare.outputs.build-title }} - secrets: - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - - publish_s3: - name: Publish - needs: [ prepare, build-android, build-ios, build-linux, build-macos, build-web, build-windows ] - if: ${{ always() }} - uses: JagandeepBrar/LunaSea/.github/workflows/publish_s3.yml@master - with: - flavor: ${{ github.event.inputs.flavor || 'edge' }} - build-title: ${{ needs.prepare.outputs.build-title }} - enable-android: ${{ needs.prepare.outputs.enable-android }} - enable-ios: ${{ needs.prepare.outputs.enable-ios }} - enable-linux: ${{ needs.prepare.outputs.enable-linux }} - enable-macos: ${{ needs.prepare.outputs.enable-macos }} - enable-web: ${{ needs.prepare.outputs.enable-web }} - enable-windows: ${{ needs.prepare.outputs.enable-windows }} - secrets: - DISCORD_WEBHOOK_EDGE: ${{ secrets.DISCORD_WEBHOOK_EDGE }} - DISCORD_WEBHOOK_BETA: ${{ secrets.DISCORD_WEBHOOK_BETA }} - DISCORD_WEBHOOK_CANDIDATE: ${{ secrets.DISCORD_WEBHOOK_CANDIDATE }} - DISCORD_WEBHOOK_STABLE: ${{ secrets.DISCORD_WEBHOOK_STABLE }} S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} S3_BUCKET: ${{ secrets.S3_BUCKET }} S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} S3_KEY_ID: ${{ secrets.S3_KEY_ID }} S3_REGION: ${{ secrets.S3_REGION }} + + publish-ios: + name: Publish iOS + needs: [ prepare, build-ios ] + uses: JagandeepBrar/LunaSea/.github/workflows/publish_ios.yml@master + with: + flavor: ${{ github.event.inputs.flavor || 'edge' }} + build-number: ${{ needs.prepare.outputs.build-number }} + build-title: ${{ needs.prepare.outputs.build-title }} + secrets: + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }} + APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }} + APPLE_STORE_CONNECT_KEY: ${{ secrets.APPLE_STORE_CONNECT_KEY }} + APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} + S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} + S3_BUCKET: ${{ secrets.S3_BUCKET }} + S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} + S3_KEY_ID: ${{ secrets.S3_KEY_ID }} + S3_REGION: ${{ secrets.S3_REGION }} + + publish-linux: + name: Publish Linux + needs: [ prepare, build-linux ] + uses: JagandeepBrar/LunaSea/.github/workflows/publish_linux.yml@master + with: + flavor: ${{ github.event.inputs.flavor || 'edge' }} + build-number: ${{ needs.prepare.outputs.build-number }} + build-title: ${{ needs.prepare.outputs.build-title }} + secrets: + SNAPCRAFT_TOKEN: ${{ secrets.SNAPCRAFT_TOKEN }} + S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} + S3_BUCKET: ${{ secrets.S3_BUCKET }} + S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} + S3_KEY_ID: ${{ secrets.S3_KEY_ID }} + S3_REGION: ${{ secrets.S3_REGION }} + + publish-macos: + name: Publish macOS + needs: [ prepare, build-macos ] + uses: JagandeepBrar/LunaSea/.github/workflows/publish_macos.yml@master + with: + flavor: ${{ github.event.inputs.flavor || 'edge' }} + build-number: ${{ needs.prepare.outputs.build-number }} + build-title: ${{ needs.prepare.outputs.build-title }} + secrets: + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }} + APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }} + APPLE_STORE_CONNECT_KEY: ${{ secrets.APPLE_STORE_CONNECT_KEY }} + APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} + S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} + S3_BUCKET: ${{ secrets.S3_BUCKET }} + S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} + S3_KEY_ID: ${{ secrets.S3_KEY_ID }} + S3_REGION: ${{ secrets.S3_REGION }} + + publish-web: + name: Publish Web + needs: [ prepare, build-web ] + uses: JagandeepBrar/LunaSea/.github/workflows/publish_web.yml@master + with: + flavor: ${{ github.event.inputs.flavor || 'edge' }} + build-number: ${{ needs.prepare.outputs.build-number }} + build-title: ${{ needs.prepare.outputs.build-title }} + secrets: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} + S3_BUCKET: ${{ secrets.S3_BUCKET }} + S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} + S3_KEY_ID: ${{ secrets.S3_KEY_ID }} + S3_REGION: ${{ secrets.S3_REGION }} + + publish-windows: + name: Publish Windows + needs: [ prepare, build-windows ] + uses: JagandeepBrar/LunaSea/.github/workflows/publish_windows.yml@master + with: + flavor: ${{ github.event.inputs.flavor || 'edge' }} + build-number: ${{ needs.prepare.outputs.build-number }} + build-title: ${{ needs.prepare.outputs.build-title }} + secrets: + S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} + S3_BUCKET: ${{ secrets.S3_BUCKET }} + S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} + S3_KEY_ID: ${{ secrets.S3_KEY_ID }} + S3_REGION: ${{ secrets.S3_REGION }} + + notify: + name: Notify + needs: [ prepare, publish-android, publish-ios, publish-linux, publish-macos, publish-web, publish-windows ] + if: | + always() && + !cancelled() && + (needs.publish-android == 'success' || needs.publish-android == 'skipped') && + (needs.publish-ios == 'success' || needs.publish-ios == 'skipped') && + (needs.publish-linux == 'success' || needs.publish-linux == 'skipped') && + (needs.publish-macos == 'success' || needs.publish-macos == 'skipped') && + (needs.publish-web == 'success' || needs.publish-web == 'skipped') && + (needs.publish-windows == 'success' || needs.publish-windows == 'skipped') + uses: JagandeepBrar/LunaSea/.github/workflows/notify.yml@master + with: + flavor: ${{ github.event.inputs.flavor || 'edge' }} + build-title: ${{ needs.prepare.outputs.build-title }} + enable-android: ${{ needs.prepare.outputs.enable-android && needs.publish-android == 'success' }} + enable-ios: ${{ needs.prepare.outputs.enable-ios && needs.publish-ios == 'success' }} + enable-linux: ${{ needs.prepare.outputs.enable-linux && needs.publish-linux == 'success' }} + enable-macos: ${{ needs.prepare.outputs.enable-macos && needs.publish-macos == 'success' }} + enable-web: ${{ needs.prepare.outputs.enable-web && needs.publish-web == 'success' }} + enable-windows: ${{ needs.prepare.outputs.enable-windows && needs.publish-windows == 'success' }} + secrets: + DISCORD_WEBHOOK_EDGE: ${{ secrets.DISCORD_WEBHOOK_EDGE }} + DISCORD_WEBHOOK_BETA: ${{ secrets.DISCORD_WEBHOOK_BETA }} + DISCORD_WEBHOOK_CANDIDATE: ${{ secrets.DISCORD_WEBHOOK_CANDIDATE }} + DISCORD_WEBHOOK_STABLE: ${{ secrets.DISCORD_WEBHOOK_STABLE }}