-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
13 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,27 +67,30 @@ jobs: | |
- name: Get git commit | ||
id: git-commit | ||
run: echo "::set-output name=sha::$(git rev-parse --short HEAD)" | ||
- name: print preid | ||
env: | ||
BRANCH: ${{ steps.git-branch.outputs.branch }} | ||
SHA: ${{ steps.git-commit.outputs.sha }} | ||
run: echo $BRANCH.$SHA | ||
- name: Set preid | ||
id: preid | ||
run: | | ||
if [ "${{ steps.git-branch.outputs.branch }}" = "beta" ]; then | ||
echo "preid=beta" >> "$GITHUB_OUTPUT" | ||
else | ||
echo "preid=alpha.${{ steps.git-commit.outputs.sha }}" >> "$GITHUB_OUTPUT" | ||
fi | ||
- name: Setup git | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
- name: Publish to NPM | ||
env: | ||
BRANCH: ${{ steps.git-branch.outputs.branch }} | ||
SHA: ${{ steps.git-commit.outputs.sha }} | ||
run: npx lerna publish prepatch --preid alpha.$SHA --dist-tag $BRANCH --yes --no-push | ||
- name: Get alpha package versions | ||
id: alpha | ||
PREID: ${{ steps.preid.outputs.preid }} | ||
run: npx lerna publish prepatch --preid $PREID --dist-tag $BRANCH --yes --no-push | ||
- name: Get package versions | ||
id: versions | ||
run: | | ||
echo "connect=$(cat packages/connect/package.json | jq -r '.version')" >> "$GITHUB_OUTPUT" | ||
echo "connectreact=$(cat packages/connect-react/package.json | jq -r '.version')" >> "$GITHUB_OUTPUT" | ||
echo "connectui=$(cat packages/connect-ui/package.json | jq -r '.version')" >> "$GITHUB_OUTPUT" | ||
- uses: janniks/[email protected] | ||
with: | ||
header: "> This PR was published to npm with the alpha versions:\n> - connect `npm install @stacks/connect@${{ steps.alpha.outputs.connect }} --save-exact`\n> - connect-react `npm install @stacks/connect-react@${{ steps.alpha.outputs.connectreact }} --save-exact`\n> - connect-ui `npm install @stacks/connect-ui@${{ steps.alpha.outputs.connectui }} --save-exact`" | ||
header: "> This PR was published to npm with versions:\n> - connect `npm install @stacks/connect@${{ steps.versions.outputs.connect }} --save-exact`\n> - connect-react `npm install @stacks/connect-react@${{ steps.versions.outputs.connectreact }} --save-exact`\n> - connect-ui `npm install @stacks/connect-ui@${{ steps.versions.outputs.connectui }} --save-exact`" | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |