1
1
mirror of https://github.com/Yvee1/hascard.git synced 2024-11-22 04:33:06 +03:00

Fix release version in Github Actions

This commit is contained in:
Steven van den Broek 2021-07-16 22:23:47 +02:00
parent 24d4e10a58
commit 41a33916e6
3 changed files with 6 additions and 4 deletions

View File

@ -1,14 +1,14 @@
set -o errexit -o verbose
if test ! "$GITHUB_REF"
if test ! "$RELEASE_VERSION"
then
echo 'This is not a release build.'
else
echo "Attaching binary for $RUNNER_OS to $GITHUB_REF..."
echo "Attaching binary for $RUNNER_OS to $RELEASE_VERSION..."
OWNER="$(echo "$GITHUB_REPOSITORY" | cut -f1 -d/)"
REPO="$(echo "$GITHUB_REPOSITORY" | cut -f2 -d/)"
BIN="$(stack path --local-install-root)/bin/$REPO"
BUNDLE_NAME="$REPO-$GITHUB_REF-$RUNNER_OS.tar.gz"
BUNDLE_NAME="$REPO-$RELEASE_VERSION-$RUNNER_OS.tar.gz"
cp "$BIN" "./$REPO"
chmod +x "./$REPO"
tar -czf "$BUNDLE_NAME" "$REPO"

View File

@ -1,6 +1,6 @@
set -o errexit -o verbose
if test ! "$GITHUB_REF"
if test ! "$RELEASE_VERSION"
then
echo 'This is not a release build.'
else

View File

@ -6,6 +6,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set tag environment
run: if [[ "$GITHUB_REF" == refs/tags/* ]]; then echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV; else echo "not a release build"; fi
- name: Install ghr
run: ./.github/scripts/install-ghr.sh
- name: Install stack