Skip to content

Commit

Permalink
add npm publish script
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed May 11, 2023
1 parent c6ccb87 commit 9ee90b3
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/npm-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@

name: npm publish

on:
release:
types: [created]

jobs:
publish-npm:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/
cache: yarn

- uses: supplypike/setup-bin@v3
with:
uri: 'https://github.com/calcit-lang/calcit/releases/download/0.6.27/cr'
name: 'cr'
version: '0.6.27'

- uses: supplypike/setup-bin@v3
with:
uri: 'https://github.com/calcit-lang/calcit/releases/download/0.6.27/caps'
name: 'caps'
version: '0.6.27'

- run: caps --ci && yarn && yarn compile-server && yarn compile-page && yarn release-page

# - run: mkdir -p dist-server && mv js-out/bundle.js dist-server
# name: Copy server scripts

- name: Upload web assets
id: deploy
uses: Pendect/[email protected]
env:
DEPLOY_KEY: ${{secrets.rsync_private_key}}
with:
flags: '-avzr --progress'
options: ''
ssh_options: ''
src: 'dist/*'
dest: '[email protected]:/web-assets/repo/${{ github.repository }}'

- name: Display status from deploy
run: echo "${{ steps.deploy.outputs.status }}"

# - name: Upload server script
# id: deploy-server
# uses: Pendect/[email protected]
# env:
# DEPLOY_KEY: ${{secrets.rsync_private_key}}
# with:
# flags: '-avzr --progress'
# options: ''
# ssh_options: ''
# src: 'dist-server/*'
# dest: '[email protected]:/servers/rebase-hell/'

# - name: Display status from deploy
# run: echo "${{ steps.deploy-server.outputs.status }}"

- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

0 comments on commit 9ee90b3

Please sign in to comment.