Skip to content

Commit

Permalink
Set working dir. Separate steps. Publish and git tag
Browse files Browse the repository at this point in the history
  • Loading branch information
narin committed Oct 25, 2023
1 parent 3fc2233 commit cf0f892
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,31 @@ jobs:
runs-on: ubuntu-latest
env:
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_KEY }}
working-directory: packages/${{ inputs.package }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- run: yarn install
- name: Install dependencies in components
run: yarn install
- name: Bump version and publish to NPM
id: bump-version
run: |
cd packages/${{ inputs.package }}
NPM_PACKAGE=$(jq -r .name package.json)
echo "NPM Package name: $NPM_PACKAGE"
LATEST_VERSION=$(npm view $NPM_PACKAGE version)
echo "Latest NPM version: $LATEST_VERSION"
npm version ${{ inputs.version_bump }}
NEW_VERSION=$(jq -r .version package.json)
GIT_TAG="${{ inputs.package }}-v$NEW_VERSION"
echo $GIT_TAG
echo "GIT_TAG=${{ inputs.package }}-v$NEW_VERSION" >> "$GITHUB_OUTPUT"
- name: Publish to NPM
run: yarn publish-package
- name: Git Tag
run: |
TAG=${{ steps.bump-version.outputs.GIT_TAG }}
echo $TAG
git tag -a $TAG -m $TAG
git push origin $TAG
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
timeout-minutes: 15

0 comments on commit cf0f892

Please sign in to comment.