From f73e7388e2597ce8e4839057db3a2a9fd820e984 Mon Sep 17 00:00:00 2001 From: Hien To Date: Thu, 25 Jan 2024 14:53:44 +0700 Subject: [PATCH] Combine 2 ci pipeline pre-release and nightly into one for correcting build number nightly --- .../workflows/jan-electron-build-nightly.yml | 26 +++++++++- .../jan-electron-build-pre-release.yml | 50 ------------------- 2 files changed, 24 insertions(+), 52 deletions(-) delete mode 100644 .github/workflows/jan-electron-build-pre-release.yml diff --git a/.github/workflows/jan-electron-build-nightly.yml b/.github/workflows/jan-electron-build-nightly.yml index f961ccd6f..7198f13bd 100644 --- a/.github/workflows/jan-electron-build-nightly.yml +++ b/.github/workflows/jan-electron-build-nightly.yml @@ -1,6 +1,9 @@ name: Jan Build Electron App Nightly or Manual on: + push: + branches: + - main schedule: - cron: '0 20 * * 2,3,4' # At 8 PM UTC on Tuesday, Wednesday, and Thursday, which is 3 AM UTC+7 workflow_dispatch: @@ -27,8 +30,16 @@ jobs: echo "::set-output name=public_provider::${{ github.event.inputs.public_provider }}" echo "::set-output name=ref::${{ github.ref }}" else - echo "::set-output name=public_provider::cloudflare-r2" - echo "::set-output name=ref::refs/heads/dev" + if [ ${{ github.event_name == 'schedule' }} ]; then + echo "::set-output name=public_provider::cloudflare-r2" + echo "::set-output name=ref::refs/heads/dev" + else if [ ${{ github.event_name == 'push' }} ]; then + echo "::set-output name=public_provider::cloudflare-r2" + echo "::set-output name=ref::${{ github.ref }}" + else + echo "::set-output name=public_provider::none" + echo "::set-output name=ref::${{ github.ref }}" + fi fi # Job create Update app version based on latest release tag with build number and save to output get-update-version: @@ -73,6 +84,17 @@ jobs: push_to_branch: dev new_version: ${{ needs.get-update-version.outputs.new_version }} + noti-discord-pre-release-and-update-url-readme: + needs: [build-macos, build-windows-x64, build-linux-x64, get-update-version, set-public-provider] + secrets: inherit + if: github.event_name == 'push' + uses: ./.github/workflows/template-noti-discord-and-update-url-readme.yml + with: + ref: refs/heads/dev + build_reason: Pre-release + push_to_branch: dev + new_version: ${{ needs.get-update-version.outputs.new_version }} + noti-discord-manual-and-update-url-readme: needs: [build-macos, build-windows-x64, build-linux-x64, get-update-version, set-public-provider] secrets: inherit diff --git a/.github/workflows/jan-electron-build-pre-release.yml b/.github/workflows/jan-electron-build-pre-release.yml deleted file mode 100644 index 86be3e1f2..000000000 --- a/.github/workflows/jan-electron-build-pre-release.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Jan Build Electron Pre Release - -on: - push: - branches: - - main - -jobs: - - # Job create Update app version based on latest release tag with build number and save to output - get-update-version: - uses: ./.github/workflows/template-get-update-version.yml - - build-macos: - uses: ./.github/workflows/template-build-macos.yml - secrets: inherit - needs: [get-update-version] - with: - ref: ${{ github.ref }} - public_provider: cloudflare-r2 - new_version: ${{ needs.get-update-version.outputs.new_version }} - - build-windows-x64: - uses: ./.github/workflows/template-build-windows-x64.yml - secrets: inherit - needs: [get-update-version] - with: - ref: ${{ github.ref }} - public_provider: cloudflare-r2 - new_version: ${{ needs.get-update-version.outputs.new_version }} - - build-linux-x64: - uses: ./.github/workflows/template-build-linux-x64.yml - secrets: inherit - needs: [get-update-version] - with: - ref: ${{ github.ref }} - public_provider: cloudflare-r2 - new_version: ${{ needs.get-update-version.outputs.new_version }} - - noti-discord-nightly-and-update-url-readme: - needs: [build-macos, build-windows-x64, build-linux-x64, get-update-version] - secrets: inherit - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - uses: ./.github/workflows/template-noti-discord-and-update-url-readme.yml - with: - ref: refs/heads/dev - build_reason: Nightly - push_to_branch: dev - new_version: ${{ needs.get-update-version.outputs.new_version }}