Skip to content

Commit

Permalink
Merge pull request #16 from aws-samples/fix-release
Browse files Browse the repository at this point in the history
Fix release
  • Loading branch information
ConnorKirk authored Oct 27, 2020
2 parents b887ae2 + b18e7a9 commit d3e748a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,17 @@ jobs:
- name: Build Template
run: npm run build
# Release if required
- name: Set version
- name: Setup versions in env variables
id: version
run: echo ::set-env name=THIS_VERSION::$(npm run echo-version --silent | sed s/^v//)
- name: Set latest
id: latest
run: echo ::set-env name=LATEST::$(git describe --tags $(git rev-list --tags --max-count=1) | sed s/^v// 2> /dev/null || echo '0')
run: |
function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
echo ::set-env name=THIS_VERSION::$(npm run echo-version --silent | sed s/^v//)
echo ::set-env name=THIS_VERSION_COMPARABLE::$(version $(npm run echo-version --silent | sed s/^v//))
echo ::set-env name=LATEST_VERSION_COMPARABLE::$(version $(git describe --tags $(git rev-list --tags --max-count=1) | sed s/^v// 2> /dev/null || echo '0'))
- name: Create Release
id: create_release
uses: actions/create-release@latest
if: env.THIS_VERSION > env.LATEST
if: env.THIS_VERSION_COMPARABLE > env.LATEST_VERSION_COMPARABLE
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
Expand Down

0 comments on commit d3e748a

Please sign in to comment.