Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/andrioid/md-social. markdown social media poster (experimental)
Something went wrong. Try again.
1.3 kB · 61 lines
at urfave-cli
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162#!/usr/bin/env bashset -uo pipefail#MISE description="Build Go binary for distribution"#MISE depends=["build"]
BIN_DIR="dist"# WARN: Things will go badly if BIN_DIR is emptyif [[ ! -d $BIN_DIR ]]; then echo "Error: $BIN_DIR does not exist" exit 1fi
VERSION=v0.0.1-$(git describe --tags --always || echo dev)
#rm -rf "${BIN_DIR}/*.gz" "${BIN_DIR}/*.zip"
# List all files, onceFILES=(${BIN_DIR}/*)
echo FILES: "${FILES[@]}"
# Iterate over all the filesfor f in "${FILES[@]}"; do #if [ -f "$f" ]; continue if [[ "$f" == *.zip || "$f" == *.gz ]]; then continue fi
if [[ "$f" == *.exe ]]; then zip "${f}.zip" "$f" rm $f else gzip -f "$f" fidone
# Set NPM version( cd npm || exit 1 npm version $VERSION --no-git-tag-version)
# If GH_TOKEN is not defined, print a warning and exit 0if [[ -z ${GH_TOKEN+x} || -z ${GITHUB_SHA+x} ]]; then echo "Warning: GH_TOKEN or GITHUB_SHA is missing. Cannot create release" exit 0fi
gh release create "$VERSION" --target "$GITHUB_SHA" --title "md-social $VERSION" --generate-notesgh release upload "$VERSION" dist/*.zip dist/*.gz
# Publish to NPMif [[ -z ${NPM_TOKEN+x} ]]; then echo "Warning: Unable to publish to NPM. NPM_TOKEN is missing." exit 0fi
( cd npm || exit 1 npm publish)