Skip to content

Commit

Permalink
Run as script
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrohan committed Oct 26, 2021
1 parent 6954974 commit edafd0b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ jobs:
with:
title: Release Tracking
version: yarn changeset:version
# This is a hack to make the changeset action think we npm published, so that it creates the github release
publish: |
PACKAGE_VERSION=$(node -p -e "require('./package.json').version")
git ls-remote --exit-code --tags origin "v$PACKAGE_VERSION" || echo "New tag:"
publish: script/changeset-publish
env:
GITHUB_TOKEN: ${{ secrets.GPR_AUTH_TOKEN_SHARED }}
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN_SHARED }}
10 changes: 10 additions & 0 deletions script/changeset-publish
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# This is a hack to make the changeset action think we npm published, so that it creates the github release

# Get the current version
PACKAGE_VERSION=$(jq '.version' --raw-output ./package.json)

# Check if the remote has the current version as a git tag
# If it doesn't, we echo "New tag:" which is what the changeset action expects https://github.com/changesets/action/blob/b98cec97583b917ff1dc6179dd4d230d3e439894/src/run.ts#L123
git ls-remote --exit-code --tags origin "v$PACKAGE_VERSION" || echo "New tag:"

0 comments on commit edafd0b

Please sign in to comment.