From 705d140cb125b070fff2e963d29c7e0935466fea Mon Sep 17 00:00:00 2001 From: Alessandro Boron Date: Wed, 17 Apr 2024 17:04:08 +1000 Subject: [PATCH] Upload the release App as an artifact and download it when needed --- .github/workflows/create_variant.yml | 10 ++++++++++ .github/workflows/create_variants.yml | 26 +++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create_variant.yml b/.github/workflows/create_variant.yml index 682467036d..7e99c379d0 100644 --- a/.github/workflows/create_variant.yml +++ b/.github/workflows/create_variant.yml @@ -86,7 +86,17 @@ jobs: .github scripts + - name: Download DMG artifact + id: download-dmg-artifact + continue-on-error: true + uses: actions/download-artifact@v4 + with: + name: duckduckgo-dmg + path: ${{ github.workspace }}/dmg + - name: Download release app + # Download the release app only if download-dmg-artifact fails + if: ${{ steps.download-dmg-artifact.outcome == 'failure' }} run: | curl -fLSs "${{ vars.RELEASE_DMG_URL }}" --output duckduckgo.dmg hdiutil attach duckduckgo.dmg -mountpoint vanilla diff --git a/.github/workflows/create_variants.yml b/.github/workflows/create_variants.yml index ccddcecbb2..f061a25d97 100644 --- a/.github/workflows/create_variants.yml +++ b/.github/workflows/create_variants.yml @@ -72,11 +72,35 @@ jobs: atb-asana-task-id: ${{ vars.DMG_VARIANTS_LIST_TASK_ID }} origin-asana-section-id: ${{ vars.DMG_VARIANTS_ORIGIN_SECTION_ID }} + download-dmg-and-upload-artifact: + + name: Download Release App and upload artifact + + runs-on: macos-13 + timeout-minutes: 15 + + steps: + - name: Download release app + run: | + curl -fLSs "${{ vars.RELEASE_DMG_URL }}" --output duckduckgo.dmg + hdiutil attach duckduckgo.dmg -mountpoint vanilla + mkdir -p dmg + cp -R vanilla/DuckDuckGo.app dmg/DuckDuckGo.app + hdiutil detach vanilla + rm -f duckduckgo.dmg + + - name: Upload DMG artifact + uses: actions/upload-artifact@v4 + with: + name: duckduckgo-dmg + path: ${{ github.workspace }}/dmg + retention-days: 1 + create-variants: name: Create Variant - needs: set-up-variants + needs: [set-up-variants, download-dmg-and-upload-artifact] strategy: fail-fast: false