Skip to content

Commit

Permalink
fix CI to only assemble release on 'v*' tag push or manually
Browse files Browse the repository at this point in the history
remove unnecessary condition

only automatically build a release if a 'v*' tag is pushed

bleh
  • Loading branch information
majcosta committed Jan 7, 2025
1 parent dcf2029 commit a628661
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
31 changes: 18 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,30 @@ jobs:
name: Set global variables
run: |
set -eux
full_release='${{ ( github.repository == '1dot13/source' && github.ref_name == 'master' ) || startsWith(github.ref, 'refs/tags/v') }}'
if [[ '${{ inputs.build_all_languages }}' == 'true' || ( '${{ inputs.build_all_languages }}' == '' && "$full_release" == 'true' ) ]]
all_languages="${{ inputs.build_all_languages }}"
assemble_release="${{ inputs.assemble_release }}"
repo="${{ github.repository }}"
refname="${{ github.ref_name }}"
is_tag="${{ startsWith(github.ref, 'refs/tags/v') }}"
if [ "$assemble_release" = "true" ] || [ "$repo" = "1dot13/source" && "$refname" = "master" && "$is_tag" = "true" ]
then
languages_json_array='["Chinese", "German", "English", "French", "Polish", "Italian", "Dutch", "Russian"]';
full_release='true'
else
# English + some other language for compilation testing
languages_json_array='["German", "English"]'
full_release='false'
fi
echo "languages_json_array=$languages_json_array" >> $GITHUB_OUTPUT
if [[ '${{ inputs.assemble_release }}' == 'true' || ( '${{ inputs.assemble_release }}' == '' && "$full_release" == 'true' ) ]]
if [ "$all_languages" = "true" ] || [ "$full_release" = "true" ]
then
assemble_release='true'
languages_json_array='["Chinese", "German", "English", "French", "Polish", "Italian", "Dutch", "Russian"]';
else
assemble_release='false'
# English + some other language for compilation testing
languages_json_array='["German", "English"]'
fi
echo "assemble_release=$assemble_release" >> $GITHUB_OUTPUT
echo "languages_json_array=$languages_json_array" >> "$GITHUB_OUTPUT"
echo "assemble_release=$full_release" >> "$GITHUB_OUTPUT"
- name: Clone repos metadata
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_language.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
assemble:
description: 'assemble full package'
required: true
default: true
default: false
type: boolean
continue-on-error:
description: 'allows a language to fail, used when building all languages'
Expand Down

0 comments on commit a628661

Please sign in to comment.