mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-09 17:44:01 -07:00
simplified build workflow
This commit is contained in:
parent
f28ede7ae3
commit
4877990020
1 changed files with 29 additions and 27 deletions
24
.github/workflows/desktop-build.yml
vendored
24
.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)
|
||||
concurrency:
|
||||
group: "${{ github.workflow }} @ ${{ github.ref_name }}"
|
||||
group: ${{ github.workflow }} @ ${{ github.ref_name }}
|
||||
cancel-in-progress: ${{ github.ref_type != 'tag' }}
|
||||
|
||||
jobs:
|
||||
|
|
@ -49,20 +49,22 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: "Configure"
|
||||
env:
|
||||
RESOLVED_SHA: >-
|
||||
${{
|
||||
case(
|
||||
github.event_name == 'pull_reuqest',
|
||||
github.event.pull_request.head.sha,
|
||||
github.sha
|
||||
)
|
||||
}}
|
||||
id: configure
|
||||
shell: bash
|
||||
run: |
|
||||
tag_regex='^refs/tags/'
|
||||
if [[ $GITHUB_EVENT_NAME == pull-request ]]; then # pull request
|
||||
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"
|
||||
if [[ "$GITHUB_REF_TYPE" == 'tag' ]]; then # release
|
||||
echo "tag=$GITHUB_REF_NAME" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
echo "sha=$sha" >>"$GITHUB_OUTPUT"
|
||||
echo "sha=$RESOLVED_SHA" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: "Checkout"
|
||||
if: steps.configure.outputs.tag != null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue