-
Notifications
You must be signed in to change notification settings - Fork 16
89 lines (73 loc) · 3.01 KB
/
on_push.yml
File metadata and controls
89 lines (73 loc) · 3.01 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
name: Publish Package on Push
on:
push:
branches:
- oidc_publish_changes
tags-ignore:
- '**'
permissions:
id-token: write # Required for OIDC
contents: read
jobs:
release-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: node ./scripts/stableReleaseCheck.js
publish-package-npm:
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- name: Install NPM package
run: npm install
- name: get version
id: fdk-cli-version
uses: martinbeentjes/npm-get-version-action@v1.3.1
- name: Build the project
run: npm run build
- name: Installing sentry
run: npm i -g @sentry/cli@2.28.6
- name: Add Debug Id to dist
run: sentry-cli sourcemaps inject --org ${{ env.SENTRY_ORG }} --project ${{ env.SENTRY_PROJECT }} ./dist
env:
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
- name: create sentry.io release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
with:
environment: production
sourcemaps: './dist'
version: ${{ steps.fdk-cli-version.outputs.current-version }}
- name: Adding Sentry DSN
run: |
echo "{\"dsn\": \"${{ secrets.SENTRY_DSN }}\"}" > ./dist/sentry.json
- name: Delete SourceMap files
run: find ./dist -type f -name '*.map' -exec rm -f {} \;
- name: Remove token-based authentication from .npmrc
run: |
NPMRC_PATH=$(npm config get userconfig 2>/dev/null || echo "/home/runner/work/_temp/.npmrc")
if [ -f "$NPMRC_PATH" ]; then
sed -i.bak '/_authToken/d' "$NPMRC_PATH" 2>/dev/null || true
fi
# Also check temp directory
if [ -f "/home/runner/work/_temp/.npmrc" ]; then
sed -i.bak '/_authToken/d' "/home/runner/work/_temp/.npmrc" 2>/dev/null || true
fi
- name: Publish to npmjs
run: npm publish --access public