git.iko.soy/rowtype-yoga/purescm
on bytevector help sign in
rowtype-yoga/purescm/publish-release.sh
42 lines 752 B history raw
1#!/usr/bin/env bash
2# Tag and publish a new release of `purescm`
3#
4# Usage:
5#
6# ./publish-release.sh <major|minor|patch...>
7#
9set -eu
11# Fail if we are not on trunk
12BRANCH=$(git branch --show-current)
13if [ "${BRANCH}" != "master" ]; then
14 echo "Please checkout master branch"
15 exit 1;
16fi
18if [ $# -eq 0 ]
19 then
20 echo "No arguments supplied"
21 exit 1
22fi
24git pull
26# bump npm version
27npm version $1 --no-git-tag-version
29# `npm version` also updates spago.yaml, so we grap the new
30# tag name from there
31NEW_TAG=$(grep -Po "(?<=version: )([\d.]+)" spago.yaml)
33git add package.json package-lock.json spago.yaml
34git commit -m "$NEW_TAG"
35git tag "v$NEW_TAG"
37rm -rf bundle output output-es
38npm run build
40npm publish --tag latest
42git push origin