-
Notifications
You must be signed in to change notification settings - Fork 6
41 lines (35 loc) · 1.17 KB
/
publish.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
name: Package Compile and Publish
on:
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.RMG_BUILD_AND_RELEASE }}
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
working-directory: ./package
- name: Pre-publish
run: |
chmod +x ./scripts/prepublish.sh
./scripts/prepublish.sh
id: prepublish
- name: Publish to npm
run: |
cd ./package/dist
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.RMG_NPM_PUBLISH }}
- name: Trigger RMG Palette rebuild
run: |
curl -XPOST -u "wongchito:${{ secrets.RMG_BUILD_AND_RELEASE }}" \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Content-Type: application/json" https://api.github.com/repos/railmapgen/rmg-palette/actions/workflows/build.yml/dispatches \
--data '{"ref": "master", "inputs": {"auto_deploy": "PRD"}}'