Release package #23
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
name: 'Release package' | |
on: workflow_dispatch | |
jobs: | |
main: | |
name: Release package | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup Git | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Actions" | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 22 | |
cache: npm | |
- name: Install dependencies | |
run: npm ci --include=optional | |
# Semver creates a tag on the latest commit | |
# But the version bump does not create a new commit yet | |
# Since the post target needs to sync package versions | |
- name: Bump version for packages (synced) | |
run: npx nx run version | |
- name: Get created tag | |
id: get_tag | |
run: echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT | |
- name: Remove tag from last commit | |
run: git tag -d ${{ steps.get_tag.outputs.tag }} | |
- name: Commit version bump and tag as latest | |
run: | | |
git add . | |
git commit -m "chore(release): bump version to ${{ steps.get_tag.outputs.tag }}" | |
git push | |
git tag ${{ steps.get_tag.outputs.tag }} | |
git push origin ${{ steps.get_tag.outputs.tag }} | |
# Order matters for the publishing, packages with dependencies should be published last | |
- name: Publish package | |
run: | | |
echo '//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}' > ~/.npmrc | |
npx nx run open-telemetry-node:publish | |
npx nx run open-telemetry-nest:publish | |
npx nx run open-telemetry-zonneplan:publish | |