ci: only replace dev builds if all jobs succeed (#980)

Previously, development binaries were uploaded as soon as their build
job succeeded.

However, because we build for many operating systems (with different
configurations), sometimes a build would succeed on Windows, but not on
Linux, for example.

When that happened, the GitHub Releases page for development builds
would be missing binaries for some OSes, because we were removing _all_
previous binaries before we even invoked CMake.

Now, we only replace the previous development builds if _all_ build
jobs succeed.
This commit is contained in:
Guilherme Silva 2023-06-12 02:49:56 -03:00 committed by GitHub
parent 4784baad48
commit 4d0bd83010
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,28 +51,6 @@ jobs:
fetch-depth: 0 fetch-depth: 0
submodules: true submodules: true
- name: Delete old development binaries
uses: mknejp/delete-release-assets@v1
if: strategy.job-index == 0
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: devbuild
fail-if-no-assets: false
fail-if-no-release: false
assets: |
*.AppImage
*.dmg
*.exe
*.7z
- name: Update "devbuild" tag
uses: richardsimko/update-tag@v1.0.7
if: strategy.job-index == 0
with:
tag_name: devbuild
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare environment and compile application - name: Prepare environment and compile application
run: ${{ matrix.script_name }} "${{ matrix.os }}" "${{ matrix.use_webengine }}" "${{ matrix.use_qt5 }}" run: ${{ matrix.script_name }} "${{ matrix.os }}" "${{ matrix.use_webengine }}" "${{ matrix.use_qt5 }}"
env: env:
@ -81,29 +59,56 @@ jobs:
FEEDLY_CLIENT_ID: ${{ secrets.FEEDLY_CLIENT_ID }} FEEDLY_CLIENT_ID: ${{ secrets.FEEDLY_CLIENT_ID }}
FEEDLY_CLIENT_SECRET: ${{ secrets.FEEDLY_CLIENT_SECRET }} FEEDLY_CLIENT_SECRET: ${{ secrets.FEEDLY_CLIENT_SECRET }}
- name: Upload binaries
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: RSS_Guard-${{ runner.os }}${{ matrix.use_webengine == 'ON' && '-' || '-nowebengine-' }}Qt${{ matrix.use_qt5 == 'ON' && '5' || '6' }}
path: |
./rssguard-build/rssguard-*win*.exe
./rssguard-build/rssguard-*win*.7z
./rssguard-build/rssguard-*mac64.dmg
./rssguard-build/rssguard-*linux64.AppImage
dist_binaries:
name: Distribute binaries
needs:
- build-rssguard
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- name: Download binaries from previous jobs
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Release development binaries - name: Release development binaries
uses: softprops/action-gh-release@v1 if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: ncipollo/release-action@v1
with: with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: artifacts/*/*
name: Development builds
omitBodyDuringUpdate: true
prerelease: true prerelease: true
name: "Development builds" removeArtifacts: true
tag_name: "devbuild" tag: devbuild
files: |
./rssguard-build/rssguard-*win*.exe - name: Update "devbuild" tag
./rssguard-build/rssguard-*win*.7z if: ${{ !startsWith(github.ref, 'refs/tags/') }}
./rssguard-build/rssguard-*mac64.dmg uses: richardsimko/update-tag@v1
./rssguard-build/rssguard-*linux64.AppImage
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release stable binaries
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with: with:
prerelease: false tag_name: devbuild
files: |
./rssguard-build/rssguard-*win*.exe - name: Release stable binaries
./rssguard-build/rssguard-*win*.7z if: startsWith(github.ref, 'refs/tags/')
./rssguard-build/rssguard-*mac64.dmg uses: ncipollo/release-action@v1
./rssguard-build/rssguard-*linux64.AppImage with:
env: artifactErrorsFailBuild: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} artifacts: artifacts/*/*
draft: true