From adc64e45b87f223a8a86b172ab5aa6553f56d089 Mon Sep 17 00:00:00 2001 From: Clare Liguori Date: Mon, 3 Feb 2020 18:00:01 -0800 Subject: [PATCH] chore: Match package version to latest tagged version --- buildspec_integ.yml | 2 ++ package-lock.json | 2 +- package.json | 2 +- release.sh | 27 +++++++++++++++++++++++++++ 4 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 release.sh diff --git a/buildspec_integ.yml b/buildspec_integ.yml index 236052e..cc8d1a4 100644 --- a/buildspec_integ.yml +++ b/buildspec_integ.yml @@ -22,3 +22,5 @@ phases: # Run integration tests - ./run_integ_test.sh + finally: + - rm .git/credentials diff --git a/package-lock.json b/package-lock.json index ed7c6e8..e34ff7d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "aws-actions-configure-aws-credentials", - "version": "0.0.0", + "version": "1.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 7d3f878..79a61eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aws-actions-configure-aws-credentials", - "version": "0.0.0", + "version": "1.0.1", "description": "Configure AWS Credentials", "main": "index.js", "scripts": { diff --git a/release.sh b/release.sh new file mode 100644 index 0000000..c66fa14 --- /dev/null +++ b/release.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +set -ex + +# Generate a new version number and version tag, based on conventional commits +standard-version + +# Prevent major version bumps: these warrant extra scrutiny +NEW_VERSION=`cat package-lock.json | jq -r '.version'` +if [[ ! "$NEW_VERSION" =~ ^v1\. ]]; then + echo "New major version! $NEW_VERSION" + exit 1 +fi + +# Push the new version tag +git push --follow-tags origin master + +# Create a GitHub release for the new version +dpl --provider=releases \ + --name="v$NEW_VERSION" \ + --tag_name="v$NEW_VERSION" \ + --api_key="$GITHUB_TOKEN" \ + --draft=$IS_DRAFT + +# Update the 'v1' tag to point to the new version +git tag -f v1 +git push -f origin v1