Skip to content

Package Compile and Publish #187

Package Compile and Publish

Package Compile and Publish #187

Workflow file for this run

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"}}'