-
Notifications
You must be signed in to change notification settings - Fork 406
164 lines (156 loc) · 5.1 KB
/
Copy pathrelease.yml
File metadata and controls
164 lines (156 loc) · 5.1 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: Releases
on:
push:
branches:
- v3.x
- v4.x
- v5.x
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
jobs:
publish-v3:
if: github.event_name == 'push' && github.event.ref == 'refs/heads/v3.x'
runs-on: ubuntu-latest
environment:
name: npm
url: https://npmjs.com/package/dd-trace
permissions:
id-token: write
contents: write
pull-requests: read
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/node
- run: npm publish --tag latest-node14
- id: pkg
run: |
content=`cat ./package.json | tr '\n' ' '`
echo "json=$content" >> $GITHUB_OUTPUT
- run: |
git tag v${{ fromJson(steps.pkg.outputs.json).version }}
git push origin v${{ fromJson(steps.pkg.outputs.json).version }}
- run: node scripts/release/notes
publish-v4:
if: github.event_name == 'push' && github.event.ref == 'refs/heads/v4.x'
runs-on: ubuntu-latest
environment:
name: npm
url: https://npmjs.com/package/dd-trace
permissions:
id-token: write
contents: write
pull-requests: read
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/node
- run: npm publish --tag latest-node16
- id: pkg
run: |
content=`cat ./package.json | tr '\n' ' '`
echo "json=$content" >> $GITHUB_OUTPUT
- run: |
git tag v${{ fromJson(steps.pkg.outputs.json).version }}
git push origin v${{ fromJson(steps.pkg.outputs.json).version }}
- run: node scripts/release/notes
publish-latest:
if: github.event_name == 'push' && github.event.ref == 'refs/heads/v5.x'
runs-on: ubuntu-latest
environment:
name: npm
url: https://npmjs.com/package/dd-trace
permissions:
id-token: write
contents: write
pull-requests: read
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/node
- run: npm publish
- id: pkg
run: |
content=`cat ./package.json | tr '\n' ' '`
echo "json=$content" >> $GITHUB_OUTPUT
- run: |
git tag v${{ fromJson(steps.pkg.outputs.json).version }}
git push origin v${{ fromJson(steps.pkg.outputs.json).version }}
- run: node scripts/release/notes --latest
docs:
needs: "publish-latest"
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/node
- id: pkg
run: |
content=`cat ./package.json | tr '\n' ' '`
echo "json=$content" >> $GITHUB_OUTPUT
- run: yarn
- name: Build
working-directory: docs
run: |
yarn
yarn build
mv out /tmp/out
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: gh-pages
- name: Deploy
run: |
rm -rf *
mv /tmp/out/* .
git config user.name github-actions
git config user.email github-actions@github.com
git add -A
git commit -m ${{ fromJson(steps.pkg.outputs.json).version }}
git push
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
publish-dev:
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
environment:
name: npm
url: https://npmjs.com/package/dd-trace
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/node
- uses: ./.github/actions/install
- id: pkg
run: |
content=`cat ./package.json | tr '\n' ' '`
echo "json=$content" >> $GITHUB_OUTPUT
- run: npm version --no-git-tag-version ${{ fromJson(steps.pkg.outputs.json).version }}-$(git rev-parse --short HEAD)+${{ github.run_id }}.${{ github.run_attempt }}
- run: npm publish --tag dev
- run: |
git tag --force dev
git push origin :refs/tags/dev
git push origin --tags
status:
needs: ["publish-v3", "publish-v4", "publish-latest"]
if: always() && contains(needs.*.result, 'success')
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
pull-requests: read
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
sparse-checkout: scripts/release/status.js
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
- run: node scripts/release/status.js