Skip to content

Commit

Permalink
CI Deploy: Warn when not creating a tag
Browse files Browse the repository at this point in the history
Backport of musescore#24388
  • Loading branch information
shoogle authored and Jojo-Schmitz committed Sep 4, 2024
1 parent 9ed6fea commit 3cbfd2e
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ defaults:

jobs:

get_tag_info:
name: Get tag info
plan:
name: 'Plan: ${{ inputs.release_type}} (tag=${{ inputs.create_tag }})'
runs-on: ubuntu-latest
outputs:
tag_name: ${{ steps.make_tag_info.outputs.TAG_NAME }}
Expand All @@ -42,18 +42,18 @@ jobs:
git tag --list | tail -n 20
echo ==========
build/ci/release/make_tag_name.sh | tee -a "${GITHUB_OUTPUT}"
echo ==========
echo "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}"
echo ==========
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions
if [[ "${CREATE_TAG}" == 'true' ]]; then
echo "Tag will be created."
echo "::notice ::Tag will be created"
else
echo "Tag will not be created."
echo "::warning ::Tag will NOT be created"
fi
build:
name: Build
needs: get_tag_info
needs: plan
uses: ./.github/workflows/build_all.yml
secrets: inherit
with:
Expand All @@ -62,7 +62,7 @@ jobs:
publish: ${{ inputs.create_tag && 'on' || 'off' }}

create_release:
name: 'Create release: ${{ needs.get_tag_info.outputs.tag_name }}'
name: 'Create release: ${{ needs.plan.outputs.tag_name }}'
needs:
- get_tag_info # to access outputs
if: ${{ ! failure() && ! cancelled() && inputs.create_tag }} # run even if prior jobs were skipped
Expand All @@ -82,7 +82,7 @@ jobs:
build/ci/release/collate_release_binaries.sh
- name: Create tag # do this as late as possible so we're not left with a useless tag if something fails
env:
TAG_NAME: ${{ needs.get_tag_info.outputs.tag_name }}
TAG_NAME: ${{ needs.plan.outputs.tag_name }}
run: |
int="(0|[1-9][0-9]*)"
version="${int}\.${int}(\.${int})?"
Expand All @@ -102,20 +102,20 @@ jobs:
draft: true
prerelease: ${{ inputs.release_type != 'stable' }}
files: release/*
name: ${{ needs.get_tag_info.outputs.release_name }}
tag_name: ${{ needs.get_tag_info.outputs.tag_name }}
name: ${{ needs.plan.outputs.release_name }}
tag_name: ${{ needs.plan.outputs.tag_name }}
fail_on_unmatched_files: true
generate_release_notes: false

notify_users:
name: Notify users
needs:
- get_tag_info # to access outputs
- plan # to access outputs
- create_release
if: ${{ github.repository == 'musescore/MuseScore' && ! failure() && ! cancelled() && needs.create_release.result == 'success' }}
uses: ./.github/workflows/update_release_info.yml
secrets: inherit
with:
mode: ${{ inputs.release_type == 'stable' && 'stable' || 'testing' }}
tag: ${{ needs.get_tag_info.outputs.tag_name }}
tag: ${{ needs.plan.outputs.tag_name }}
environment: production # requires approval

0 comments on commit 3cbfd2e

Please sign in to comment.