mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-01 02:53:56 -07:00
moved static comparisons out of bash
This commit is contained in:
parent
c14a008080
commit
5d52464814
1 changed files with 23 additions and 17 deletions
38
.github/workflows/desktop-build.yml
vendored
38
.github/workflows/desktop-build.yml
vendored
|
|
@ -36,7 +36,7 @@ on:
|
||||||
|
|
||||||
# Cancel earlier, unfinished runs of this workflow on the same branch (unless on release)
|
# Cancel earlier, unfinished runs of this workflow on the same branch (unless on release)
|
||||||
concurrency:
|
concurrency:
|
||||||
group: "${{ github.workflow }} @ ${{ github.ref_name }}"
|
group: ${{ github.workflow }} @ ${{ github.ref_name }}
|
||||||
cancel-in-progress: ${{ github.ref_type != 'tag' }}
|
cancel-in-progress: ${{ github.ref_type != 'tag' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
@ -49,20 +49,22 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Configure
|
- name: Configure
|
||||||
|
env:
|
||||||
|
RESOLVED_SHA: >-
|
||||||
|
${{
|
||||||
|
case(
|
||||||
|
github.event_name == 'pull_reuqest',
|
||||||
|
github.event.pull_request.head.sha,
|
||||||
|
github.sha
|
||||||
|
)
|
||||||
|
}}
|
||||||
id: configure
|
id: configure
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
tag_regex='^refs/tags/'
|
if [[ "$GITHUB_REF_TYPE" == 'tag' ]]; then # release
|
||||||
if [[ $GITHUB_EVENT_NAME == pull-request ]]; then # pull request
|
echo "tag=$GITHUB_REF_NAME" >> "$GITHUB_OUTPUT"
|
||||||
sha="${{github.event.pull_request.head.sha}}"
|
|
||||||
elif [[ $GITHUB_REF =~ $tag_regex ]]; then # release
|
|
||||||
sha="$GITHUB_SHA"
|
|
||||||
tag="${GITHUB_REF/refs\/tags\//}"
|
|
||||||
echo "tag=$tag" >>"$GITHUB_OUTPUT"
|
|
||||||
else # push to branch
|
|
||||||
sha="$GITHUB_SHA"
|
|
||||||
fi
|
fi
|
||||||
echo "sha=$sha" >>"$GITHUB_OUTPUT"
|
echo "sha=$RESOLVED_SHA" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
if: steps.configure.outputs.tag != null
|
if: steps.configure.outputs.tag != null
|
||||||
|
|
@ -83,17 +85,21 @@ jobs:
|
||||||
id: create_release
|
id: create_release
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
|
args: >-
|
||||||
|
${{
|
||||||
|
case(
|
||||||
|
steps.prepare.outputs.is_beta == 'yes',
|
||||||
|
'--prerelease',
|
||||||
|
''
|
||||||
|
)
|
||||||
|
}}
|
||||||
GH_TOKEN: ${{github.token}}
|
GH_TOKEN: ${{github.token}}
|
||||||
tag_name: ${{steps.configure.outputs.tag}}
|
tag_name: ${{steps.configure.outputs.tag}}
|
||||||
target: ${{steps.configure.outputs.sha}}
|
target: ${{steps.configure.outputs.sha}}
|
||||||
release_name: ${{steps.prepare.outputs.title}}
|
release_name: ${{steps.prepare.outputs.title}}
|
||||||
body_path: ${{steps.prepare.outputs.body_path}}
|
body_path: ${{steps.prepare.outputs.body_path}}
|
||||||
prerelease: ${{steps.prepare.outputs.is_beta}}
|
|
||||||
run: |
|
run: |
|
||||||
if [[ $prerelease == yes ]]; then
|
gh release create "$tag_name" --draft --verify-tag "$args" \
|
||||||
args="--prerelease"
|
|
||||||
fi
|
|
||||||
gh release create "$tag_name" --draft --verify-tag $args \
|
|
||||||
--target "$target" --title "$release_name" \
|
--target "$target" --title "$release_name" \
|
||||||
--notes-file "$body_path"
|
--notes-file "$body_path"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue