-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (46 loc) · 1.73 KB
/
ci-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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 "actions@github.com"
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