Skip to content

Commit

Permalink
Hack around charngeset problem with root workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
Jym77 committed Sep 8, 2023
1 parent abc52fa commit ed50350
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/alfa-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,16 @@ jobs:
# This is needed to push the correct git tag
id: new
run: |
echo "version=v$(grep \"version\": packages/alfa-*/package.json | cut -d\" -f 4 | sort -u)" >> $GITHUB_OUTPUT
echo "version=$(grep \"version\": packages/alfa-*/package.json | cut -d\" -f 4 | sort -u)" >> $GITHUB_OUTPUT
- name: Hack around toplevel dependencies
# https://github.com/changesets/changesets/issues/1229
# Need to unescape the sed string to interpret ${VERSION} and re-escape it again.
run: sed -i 's/workspace:^[0-9\.]*/workspace:^'${VERSION}'/' package.json
env:
# Passing it as a variable rather than inline hardens against script injection.
# See https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
VERSION: ${{ steps.new.outputs.version }}

- name: Update lockfile
# Cross-workspaces references need to be updated.
Expand Down Expand Up @@ -123,13 +132,13 @@ jobs:
run: |
# Removed individual changesets, all changelog (global and local), all package.json (new version number), lockfile
git add .changeset/ CHANGELOG.md **/CHANGELOG.md package.json **/package.json yarn.lock
git commit -m ${{ steps.new.outputs.version }}
git commit -m ${VERSION}
git tag --annotate ${VERSION} --message=${VERSION}
git push --follow-tags
env:
# Passing it as a variable rather than inline hardens against script injection.
# See https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
VERSION: ${{ steps.new.outputs.version }}
VERSION: v${{ steps.new.outputs.version }}

- name: Make npm release
run: >
Expand All @@ -149,4 +158,4 @@ jobs:
GH_TOKEN: ${{ github.token }}
# Passing it as a variable rather than inline hardens against script injection.
# See https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
VERSION: ${{ steps.new.outputs.version }}
VERSION: v${{ steps.new.outputs.version }}

0 comments on commit ed50350

Please sign in to comment.