Skip to content

Commit

Permalink
Fix the .ci.sh and GitHub Action
Browse files Browse the repository at this point in the history
  • Loading branch information
NI committed Jul 29, 2020
1 parent a73a520 commit 21fd0de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions .ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SSHWIFTY_VERSION=$(git describe --always --dirty='*' --tag)
SSHWIFTY_COMMIT=$(git describe --always)
SSHWIFTY_RELEASE=$([ "$(echo $SSHWIFTY_VERSION | grep -oP ^[0-9]+\.[0-9]+\.[0-9]+\-[a-zA-Z0-9]+\-release$)" = '' ] || echo 'yes')
SSHWIFTY_DEPLOY=$([ "$SSHWIFTY_RELEASE" != 'yes' ] || echo 'yes')
SSHWIFTY_DOCKER_IMAGE_TAG="$DOCKER_HUB_USER/github_action_test"
SSHWIFTY_DOCKER_IMAGE_TAG="$DOCKER_HUB_USER/sshwifty"
SSHWIFTY_DOCKER_IMAGE_PUSH_TAG="$SSHWIFTY_DOCKER_IMAGE_TAG:$SSHWIFTY_VERSION"
SSHWIFTY_DOCKER_IMAGE_PUSH_TAG_LATEST="$SSHWIFTY_DOCKER_IMAGE_TAG:latest"

Expand Down Expand Up @@ -86,6 +86,8 @@ fi
echo "Version: $SSHWIFTY_VERSION"
echo "Files: $(pwd)" && ls -la
export
git status --short
git log --pretty=oneline --since="last tag"

catch retry npm install

Expand All @@ -110,7 +112,7 @@ if [ "$SSHWIFTY_DEPLOY" = 'yes' ]; then
echo "# Version $SSHWIFTY_VERSION" > ./.tmp/release/Note &&
echo >> ./.tmp/release/Note &&
echo "Updates introduced since $(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1))" >> ./.tmp/release/Note &&
git log $(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1))..HEAD --pretty=format:"- %h %s - (%an) %GK %G?" >> ./.tmp/release/Note &&
git log --since="last tag" --pretty=format:"- %h %s - (%an) %GK %G?" >> ./.tmp/release/Note &&
echo '"'"'#!/bin/sh'"'"' > ./.tmp/generated/prepare.sh &&
echo '"'"'echo Preparing for $1 ... && \'"'"' >> ./.tmp/generated/prepare.sh &&
echo '"'"'(cd $1/ && find . -maxdepth 1 -type f ! -name "SUM.*" -exec sha512sum {} \; > SUM.sha512) && \'"'"' >> ./.tmp/generated/prepare.sh &&
Expand All @@ -127,4 +129,4 @@ if [ "$SSHWIFTY_DEPLOY" = 'yes' ]; then
cat ./.tmp/release/SUM.sha512 &&
ghr -t "$GITHUB_USER_TOKEN" -u "$GITHUB_USER" -n "$SSHWIFTY_VERSION-prebuild" -b "$(cat ./.tmp/release/Note)" -delete -prerelease "$SSHWIFTY_VERSION-prebuild" ./.tmp/release
'
fi
fi
2 changes: 1 addition & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
sudo apt-get install -qq -y qemu qemu-user-static binfmt-support
sudo systemctl restart docker
chmod +x ./.ci.sh && ./.ci.sh
cp ./.ci.sh ./.github-action-ci-script.sh && chmod +x ./.github-action-ci-script.sh && ./.github-action-ci-script.sh && rm ./.github-action-ci-script.sh

0 comments on commit 21fd0de

Please sign in to comment.