Remove release creation race in build helper (#1133)

There was a race condition in the Build Helper where if multiple runners
got to the "Create draft release" step at the same time, we could get
duplicate releases created. Now, each of the build runners will upload
the artifacts to the workflow artifact feed. Then, a single runner will
create the draft release.
This commit is contained in:
Evan Simkowitz 2024-10-24 18:42:48 -07:00 committed by GitHub
parent 4fcac60f97
commit d66380d88b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -147,6 +147,7 @@ jobs:
STATIC_DOCSITE_PATH: ${{env.STATIC_DOCSITE_PATH}} STATIC_DOCSITE_PATH: ${{env.STATIC_DOCSITE_PATH}}
shell: powershell # electron-builder's Windows code signing package has some compatibility issues with pwsh, so we need to use Windows Powershell shell: powershell # electron-builder's Windows code signing package has some compatibility issues with pwsh, so we need to use Windows Powershell
# Upload artifacts to the S3 staging and to the workflow output for the draft release job
- name: Upload to S3 staging - name: Upload to S3 staging
if: github.event_name != 'workflow_dispatch' if: github.event_name != 'workflow_dispatch'
run: task artifacts:upload run: task artifacts:upload
@ -154,8 +155,21 @@ jobs:
AWS_ACCESS_KEY_ID: "${{ secrets.ARTIFACTS_KEY_ID }}" AWS_ACCESS_KEY_ID: "${{ secrets.ARTIFACTS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.ARTIFACTS_KEY_SECRET }}" AWS_SECRET_ACCESS_KEY: "${{ secrets.ARTIFACTS_KEY_SECRET }}"
AWS_DEFAULT_REGION: us-west-2 AWS_DEFAULT_REGION: us-west-2
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.runner }}
path: make
create-release:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'workflow_dispatch' }}
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: make
merge-multiple: true
- name: Create draft release - name: Create draft release
if: github.event_name != 'workflow_dispatch'
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
with: with:
prerelease: ${{ contains(github.ref_name, '-beta') }} prerelease: ${{ contains(github.ref_name, '-beta') }}
@ -173,9 +187,3 @@ jobs:
make/*.snap make/*.snap
make/*.flatpak make/*.flatpak
make/*.AppImage make/*.AppImage
- name: Upload build artifacts to workflow (manual runs only)
if: github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v4
with:
name: ${{matrix.runner}}
path: make