Skip to content

Commit

Permalink
Fix tags and releases (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgeblahblah authored Mar 25, 2024
1 parent b8fa360 commit 653d9c2
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
PREV_VERSION=$(git checkout -q HEAD^ && npm pkg get version && git switch -q -)
CURR_VERSION=$(npm pkg get version)
echo "versionChanged=$(if [ "$PREV_VERSION" = "$CURR_VERSION" ]; then echo "false"; else echo "true"; fi)" >> $GITHUB_OUTPUT
echo "version=$(echo $CURR_VERSION | xargs)" >> $GITHUB_OUTPUT
echo "version=v$(echo $CURR_VERSION | xargs)" >> $GITHUB_OUTPUT
changesets_release_pr:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -105,10 +105,22 @@ jobs:
needs: [changesets_release_pr, version_check, npm_release, native_release]
steps:
- uses: actions/checkout@v4

# This tag will get pushed by the Changesets action in the next step!
- name: Tag local repository
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -m "$VERSION" $VERSION
env:
VERSION: ${{ needs.version_check.outputs.version }}

- name: Create release in GitHub
uses: changesets/action@v1
with:
# We've already published above, but changesets needs this command to exit successfully to create the release in GitHub
publish: node -e true
# The actual release process has already completed in jobs npm_release and native_release
# Changesets will only create the tags/release if it sees "New tag:" in the publish command's output
# See https://github.com/changesets/action/blob/63ffd93140be6000b385d611d886a82c86214719/src/run.ts#L176
publish: "echo 'New tag:'"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 653d9c2

Please sign in to comment.