1
0
mirror of https://github.com/Luzifer/password.git synced 2024-09-19 10:22:56 +00:00
password/build-workflow.sh
Knut Ahlers fdd87dd956
Fix: Workflow building broken by zipping artifacts
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2018-03-21 11:26:37 +01:00

35 lines
876 B
Bash

#!/bin/bash
set -euxo pipefail
# Check for a publishable version
VERSION=$(git describe --tags --exact-match || echo "notag")
# Collect assets to pack
mkdir -p dist
unzip ./.build/password_darwin_amd64.zip -d dist
cp -r \
alfred-workflow/exec.py \
alfred-workflow/icon.png \
alfred-workflow/info.plist \
alfred-workflow/lib/workflow \
dist
# In order to have a valid version number on no tags for testing
git describe --tags >dist/version
# Create ZIP
cd dist
zip -r -9 ../PasswordGenerator.alfredworkflow *
cd -
# 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
# Upload to Github releases
github-release upload --user luzifer --repo password --tag ${VERSION} \
--name PasswordGenerator.alfredworkflow \
--file PasswordGenerator.alfredworkflow