-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (68 loc) · 2.2 KB
/
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Release
on:
- workflow_dispatch
jobs:
publish:
runs-on: ubuntu-latest
permissions:
id-token: write
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
lfs: true
submodules: true
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
- run: corepack enable
- run: yarn install --immutable
- run: yarn lint
- run: yarn publish
env:
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Export version
id: version
run: |
VERSION=$(cat packages/solarwinds-apm/package.json | jq -r '.version')
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
lambda:
needs: publish
uses: ./.github/workflows/lambda.yml
with:
type: production
version: ${{ needs.publish.outputs.version }}
secrets: inherit
draft:
needs:
- publish
- lambda
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
submodules: true
- name: Replace placeholders in release template
run: |
API=$(cat packages/solarwinds-apm/package.json | jq -r '.peerDependencies."@opentelemetry/api"')
CORE=$(cat packages/solarwinds-apm/package.json | jq -r '.dependencies."@opentelemetry/core"')
INSTRUMENTATION=$(cat packages/solarwinds-apm/package.json | jq -r '.dependencies."@opentelemetry/instrumentation"')
sed -i 's/{{arn}}/${{ needs.lambda.outputs.arn }}/' .github/RELEASE.md
sed -i "s/{{api}}/${API}/" .github/RELEASE.md
sed -i "s/{{core}}/${CORE}/" .github/RELEASE.md
sed -i "s/{{instrumentation}}/${INSTRUMENTATION}/" .github/RELEASE.md
- name: Create release draft
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ needs.publish.outputs.version }}
run: |
gh release create "v${VERSION}" \
--title "solarwinds-apm ${VERSION}" \
--notes-file ".github/RELEASE.md" \
--draft \
--verify-tag