Release - Traceloop SDK & Standalone Instrumentations #81
This file contains hidden or 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
| name: Release - Traceloop SDK & Standalone Instrumentations | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 0 | |
| ref: ${{ github.ref }} | |
| - uses: pnpm/action-setup@v2 | |
| with: | |
| version: 10 | |
| - uses: actions/setup-node@v3 | |
| with: | |
| cache: "pnpm" | |
| node-version-file: ".nvmrc" | |
| - run: pnpm install --frozen-lockfile | |
| - name: Build | |
| run: pnpm nx run-many --target=build --parallel=3 | |
| - name: Git Identity | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| git remote set-url origin https://github-actions[bot]:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} | |
| - name: Create Version | |
| run: pnpm lerna version --no-private --conventional-commits --yes | |
| - name: Set Current Version | |
| run: | | |
| CURRENT_VERSION=$(node -p 'require("./lerna.json").version') | |
| echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| body_path: "CHANGELOG.md" | |
| tag_name: ${{ env.CURRENT_VERSION }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} | |
| - name: "NPM Identity" | |
| env: | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: | | |
| echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc | |
| - name: Build for Release | |
| run: pnpm nx run-many --target=build --parallel=3 | |
| - name: Publish | |
| run: pnpm lerna publish --no-private from-git --yes |