3105: Fix publish release CI r=Kerollmops a=curquiza

Fix CI to avoid release creation when triggering manually the CI with `workflow_dispatch` -> only trigger the upload of binary when the event is `release` instead of different of `schedule`

Co-authored-by: curquiza <clementine@meilisearch.com>
This commit is contained in:
bors[bot] 2022-11-22 10:49:52 +00:00 committed by GitHub
commit 6784d17d0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,7 +18,7 @@ jobs:
# If yes, it means we are publishing an official release. # If yes, it means we are publishing an official release.
# If no, we are releasing a RC, so no need to check the version. # If no, we are releasing a RC, so no need to check the version.
- name: Check tag format - name: Check tag format
if: github.event_name != 'schedule' if: github.event_name == 'release'
id: check-tag-format id: check-tag-format
run: | run: |
escaped_tag=$(printf "%q" ${{ github.ref_name }}) escaped_tag=$(printf "%q" ${{ github.ref_name }})
@ -29,7 +29,7 @@ jobs:
echo ::set-output name=stable::false echo ::set-output name=stable::false
fi fi
- name: Check release validity - name: Check release validity
if: github.event_name != 'schedule' && steps.check-tag-format.outputs.stable == 'true' if: github.event_name == 'release' && steps.check-tag-format.outputs.stable == 'true'
run: bash .github/scripts/check-release.sh run: bash .github/scripts/check-release.sh
publish: publish:
@ -60,7 +60,7 @@ jobs:
run: cargo build --release --locked run: cargo build --release --locked
# No need to upload binaries for dry run (cron) # No need to upload binaries for dry run (cron)
- name: Upload binaries to release - name: Upload binaries to release
if: github.event_name != 'schedule' if: github.event_name == 'release'
uses: svenstaro/upload-release-action@v1-release uses: svenstaro/upload-release-action@v1-release
with: with:
repo_token: ${{ secrets.MEILI_BOT_GH_PAT }} repo_token: ${{ secrets.MEILI_BOT_GH_PAT }}
@ -98,7 +98,7 @@ jobs:
args: --release --target ${{ matrix.target }} args: --release --target ${{ matrix.target }}
- name: Upload the binary to release - name: Upload the binary to release
# No need to upload binaries for dry run (cron) # No need to upload binaries for dry run (cron)
if: github.event_name != 'schedule' if: github.event_name == 'release'
uses: svenstaro/upload-release-action@v1-release uses: svenstaro/upload-release-action@v1-release
with: with:
repo_token: ${{ secrets.MEILI_BOT_GH_PAT }} repo_token: ${{ secrets.MEILI_BOT_GH_PAT }}
@ -168,7 +168,7 @@ jobs:
- name: Upload the binary to release - name: Upload the binary to release
# No need to upload binaries for dry run (cron) # No need to upload binaries for dry run (cron)
if: github.event_name != 'schedule' if: github.event_name == 'release'
uses: svenstaro/upload-release-action@v1-release uses: svenstaro/upload-release-action@v1-release
with: with:
repo_token: ${{ secrets.MEILI_BOT_GH_PAT }} repo_token: ${{ secrets.MEILI_BOT_GH_PAT }}