2017-09-22 15:52:10 +00:00
|
|
|
#!/bin/bash
|
2018-03-21 10:21:54 +00:00
|
|
|
set -euxo pipefail
|
2017-09-22 15:52:10 +00:00
|
|
|
|
|
|
|
# Check for a publishable version
|
|
|
|
VERSION=$(git describe --tags --exact-match || echo "notag")
|
|
|
|
|
|
|
|
# Collect assets to pack
|
|
|
|
mkdir -p dist
|
2018-03-21 10:21:54 +00:00
|
|
|
unzip ./.build/password_darwin_amd64.zip -d dist
|
|
|
|
cp -r \
|
2017-09-22 15:52:10 +00:00
|
|
|
alfred-workflow/exec.py \
|
|
|
|
alfred-workflow/icon.png \
|
|
|
|
alfred-workflow/info.plist \
|
|
|
|
alfred-workflow/lib/workflow \
|
|
|
|
dist
|
2018-03-21 10:21:54 +00:00
|
|
|
|
|
|
|
# In order to have a valid version number on no tags for testing
|
|
|
|
git describe --tags >dist/version
|
2017-09-22 15:52:10 +00:00
|
|
|
|
|
|
|
# Create ZIP
|
|
|
|
cd dist
|
|
|
|
zip -r -9 ../PasswordGenerator.alfredworkflow *
|
|
|
|
cd -
|
|
|
|
|
2018-03-21 10:21:54 +00:00
|
|
|
# If there is no version tag the artifact is not to be published
|
|
|
|
if (test "${VERSION}" == "notag"); then
|
|
|
|
echo "No exact tag found, no publishing required."
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2017-09-22 15:52:10 +00:00
|
|
|
# Upload to Github releases
|
|
|
|
github-release upload --user luzifer --repo password --tag ${VERSION} \
|
|
|
|
--name PasswordGenerator.alfredworkflow \
|
|
|
|
--file PasswordGenerator.alfredworkflow
|