From f0bfa8f9554c52fb776f680b70c67c1527f3006a Mon Sep 17 00:00:00 2001 From: Deepak Jangid Date: Mon, 19 Aug 2024 23:47:00 +0530 Subject: [PATCH] add separate release for mac intel in github workflow --- .github/workflows/release.yml | 51 +++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 737f370e..4e664b32 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,6 +21,7 @@ jobs: NEXT_VERSION: "${{ inputs.next-version }}" outputs: dmg_filename: "Wallet Recovery Wizard-${{ inputs.next-version }}-arm64.dmg" + dmg_filename_intel: "Wallet Recovery Wizard-${{ inputs.next-version }}.dmg" exe_filename: "Wallet Recovery Wizard-Setup-${{ inputs.next-version }}.exe" deb_filename: "Wallet Recovery Wizard-Linux-${{ inputs.next-version }}.deb" steps: @@ -79,6 +80,31 @@ jobs: path: "release/${{ env.NEXT_VERSION }}/${{ env.DMG_FILENAME }}" if-no-files-found: "error" + mac-build_intel: + name: Create Mac Intel release + runs-on: macos-13 + needs: + - get-current-state + env: + DMG_FILENAME_INTEL: "${{ needs.get-current-state.outputs.dmg_filename_intel }}" + NEXT_VERSION: "${{ inputs.next-version }}" + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + cache: 'npm' + - run: | + sed -i -e 's/0.0.0-placeholder-version/${{ env.NEXT_VERSION }}/g' "package.json" + sed -i -e 's/0.0.0-placeholder-version/${{ env.NEXT_VERSION }}/g' "package-lock.json" + - run: npm ci + - run: npm run build + - uses: actions/upload-artifact@v4 + with: + name: "${{ env.DMG_FILENAME_INTEL }}" + path: "release/${{ env.NEXT_VERSION }}/${{ env.DMG_FILENAME_INTEL }}" + if-no-files-found: "error" + windows-linux-build: name: Create Windows and Linux release runs-on: ubuntu-latest @@ -114,9 +140,11 @@ jobs: needs: - get-current-state - mac-build + - mac-build_intel - windows-linux-build env: DMG_FILENAME: "${{ needs.get-current-state.outputs.dmg_filename }}" + DMG_FILENAME_INTEL: "${{ needs.get-current-state.outputs.dmg_filename_intel }}" EXE_FILENAME: "${{ needs.get-current-state.outputs.exe_filename }}" DEB_FILENAME: "${{ needs.get-current-state.outputs.deb_filename }}" NEXT_VERSION: "${{ inputs.next-version }}" @@ -129,6 +157,7 @@ jobs: - run: | ls -la sha256sum "${{ env.DMG_FILENAME }}" > "${{ env.DMG_FILENAME }}.sha256sum" + sha256sum "${{ env.DMG_FILENAME_INTEL }}" > "${{ env.DMG_FILENAME_INTEL }}.sha256sum" sha256sum "${{ env.DEB_FILENAME }}" > "${{ env.DEB_FILENAME }}.sha256sum" sha256sum "${{ env.EXE_FILENAME }}" > "${{ env.EXE_FILENAME }}.sha256sum" @@ -171,6 +200,28 @@ jobs: -H "Content-Type: application/octet-stream" \ "${{ steps.get-new-release-id.outputs.new_release_url }}?name=$target_dmg_filename.sha256sum" \ --data-binary "@${{ env.DMG_FILENAME }}.sha256sum" + + - name: Add the Mac Intel assets to the release + run: | + target_dmg_filename_intel=$(echo "${{ env.DMG_FILENAME_INTEL }}" | sed 's/\ /\./g') + + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ github.token }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + -H "Content-Type: application/octet-stream" \ + "${{ steps.get-new-release-id.outputs.new_release_url }}?name=$target_dmg_filename_intel" \ + --data-binary "@${{ env.DMG_FILENAME_INTEL }}" + + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ github.token }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + -H "Content-Type: application/octet-stream" \ + "${{ steps.get-new-release-id.outputs.new_release_url }}?name=$target_dmg_filename_intel.sha256sum" \ + --data-binary "@${{ env.DMG_FILENAME_INTEL }}.sha256sum" - name: Add the Linux assets to the release run: |