Skip to content

Commit

Permalink
fix: release workflow (#3473)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverschuerch authored Aug 28, 2024
1 parent fb45309 commit 7895901
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,23 @@ jobs:
# This will fail the build if something in the publish setup is not correct
# before changeset magic is starting to run
- name: Test publish step
run: pnpm -r publish --dry-run
run: |
branch=$(git rev-parse --symbolic-full-name --abbrev-ref HEAD);
- name: Get Release Tag
id: release-tag
uses: actions/github-script@v7
env:
REF_NAME: ${{ github.ref_name }}
with:
script: |
if (process.env.REF_NAME !== 'main') {
return ` -- --tag ${process.env.REF_NAME.split('/').pop()}`;
} else {
return '';
}
if [[ $branch != \"main\" ]];
then pnpm -r publish --publish-branch $branch --tag ${branch:8:2} --dry-run;
else pnpm -r publish --dry-run;
fi;
- name: Get publish command
id: command
run: |
branch=$(git rev-parse --symbolic-full-name --abbrev-ref HEAD);
if [[ $branch != \"main\" ]];
then echo "publish=pnpm changeset publish --tag ${branch:8:2}" >> "$GITHUB_OUTPUT";
else echo "publish=pnpm changeset:publish" >> "$GITHUB_OUTPUT";
fi;
# The changeset action will behave differently based on whether there are
# new changesets on the github.ref branch:
Expand All @@ -54,7 +57,7 @@ jobs:
with:
title: 'chore(changesets): 🦋📦 publish packages (${{ github.ref_name }})'
commit: 'chore(changesets): publish packages'
publish: pnpm changeset:publish${{ steps.release-tag.outputs.result }}
publish: ${{ steps.command.outputs.publish }}
version: pnpm changeset:version

- name: Create Summary
Expand Down

0 comments on commit 7895901

Please sign in to comment.