diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 3c15c90e..bf3484e7 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -29,6 +29,7 @@ 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 @@ -36,19 +37,23 @@ jobs: 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