set release upload_url correctly during configure (#4225)
correctly set prerelease flag set prerelease names to their tag instead of full release name detect version for use in release name during configuration
This commit is contained in:
parent
b63145c0a1
commit
0c54cdf6bc
1 changed files with 23 additions and 14 deletions
37
.github/workflows/ci-builds.yml
vendored
37
.github/workflows/ci-builds.yml
vendored
|
@ -21,10 +21,10 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
name: ${{steps.configure.outputs.name}}
|
|
||||||
tag: ${{steps.configure.outputs.tag}}
|
tag: ${{steps.configure.outputs.tag}}
|
||||||
release_url: ${{steps.create_release.outputs.upload_url}}
|
upload_url: ${{steps.create_release.outputs.upload_url}}
|
||||||
is_beta: ${{steps.configure.outputs.is_beta}}
|
is_beta: ${{steps.configure.outputs.is_beta}}
|
||||||
|
sha: ${{steps.configure.outputs.sha}}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Cancel previous runs
|
- name: Cancel previous runs
|
||||||
|
@ -39,20 +39,22 @@ jobs:
|
||||||
tag_regex='^refs/tags/'
|
tag_regex='^refs/tags/'
|
||||||
beta_regex='beta'
|
beta_regex='beta'
|
||||||
if [[ $GITHUB_EVENT_NAME == pull-request ]]; then # pull request
|
if [[ $GITHUB_EVENT_NAME == pull-request ]]; then # pull request
|
||||||
name="${{github.event.pull_request.head.sha}}"
|
sha="${{github.event.pull_request.head.sha}}"
|
||||||
elif [[ $GITHUB_REF =~ $tag_regex ]]; then # release
|
elif [[ $GITHUB_REF =~ $tag_regex ]]; then # release
|
||||||
tag="${GITHUB_REF/refs\/tags\//}"
|
tag="${GITHUB_REF/refs\/tags\//}"
|
||||||
name="$tag-$GITHUB_SHA"
|
sha="$GITHUB_SHA"
|
||||||
echo "::set-output name=tag::$tag"
|
echo "::set-output name=tag::$tag"
|
||||||
if [[ $tag =~ beta_regex ]]; then
|
if [[ $tag =~ beta_regex ]]; then
|
||||||
echo "::set-output name=is_beta::yes"
|
echo "::set-output name=is_beta::yes"
|
||||||
else
|
else
|
||||||
echo "::set-output name=is_beta::no"
|
echo "::set-output name=is_beta::no"
|
||||||
|
version="${tag##*-}"
|
||||||
|
echo "::set-output name=version::$version"
|
||||||
fi
|
fi
|
||||||
else # push to branch
|
else # push to branch
|
||||||
name="$GITHUB_SHA"
|
sha="$GITHUB_SHA"
|
||||||
fi
|
fi
|
||||||
echo "::set-output name=name::$name"
|
echo "::set-output name=sha::$sha"
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
if: steps.configure.outputs.tag != null
|
if: steps.configure.outputs.tag != null
|
||||||
|
@ -64,15 +66,22 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
name_regex='set\(GIT_TAG_RELEASENAME "([[:print:]]+)")'
|
name_regex='set\(GIT_TAG_RELEASENAME "([[:print:]]+)")'
|
||||||
if [[ $(cat CMakeLists.txt) =~ $name_regex ]]; then
|
if [[ "${{steps.configure.outputs.is_beta}}" == "yes" ]]; then
|
||||||
name="${BASH_REMATCH[1]}"
|
title="${{steps.configure.outputs.tag}}"
|
||||||
title="Cockatrice ${{steps.configure.name}}: $name"
|
echo "creating beta release '$title'"
|
||||||
echo "::set-output name=name::$name"
|
|
||||||
echo "::set-output name=title::$title"
|
|
||||||
else
|
else
|
||||||
echo "::error::could not find releasename in CMakeLists.txt"
|
if [[ $(cat CMakeLists.txt) =~ $name_regex ]]; then
|
||||||
exit 1
|
name="${BASH_REMATCH[1]}"
|
||||||
|
version="${{steps.configure.outputs.version}}"
|
||||||
|
title="Cockatrice $version: $name"
|
||||||
|
echo "::set-output name=friendly_name::$name"
|
||||||
|
echo "creating full release '$title'"
|
||||||
|
else
|
||||||
|
echo "::error::could not find releasename in CMakeLists.txt"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
echo "::set-output name=title::$title"
|
||||||
|
|
||||||
- name: Create release
|
- name: Create release
|
||||||
if: steps.configure.outputs.tag != null
|
if: steps.configure.outputs.tag != null
|
||||||
|
@ -84,7 +93,7 @@ jobs:
|
||||||
tag_name: ${{github.ref}}
|
tag_name: ${{github.ref}}
|
||||||
release_name: ${{steps.title.outputs.title}}
|
release_name: ${{steps.title.outputs.title}}
|
||||||
draft: true
|
draft: true
|
||||||
prerelease: ${{steps.configure.is_beta == 'yes'}}
|
prerelease: ${{steps.configure.outputs.is_beta == 'yes'}}
|
||||||
|
|
||||||
build-linux:
|
build-linux:
|
||||||
strategy:
|
strategy:
|
||||||
|
|
Loading…
Reference in a new issue