Skip to content

Commit

Permalink
ci publish (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
mununki authored Mar 28, 2024
1 parent aa7844a commit 09ca78f
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/actions/setup-engines/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ runs:
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://registry.npmjs.org"

- uses: pnpm/action-setup@v2
name: Install pnpm
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: ppx_spice publish

on: [workflow_dispatch]

jobs:
build_test:
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v4

- uses: ./.github/actions/setup-engines

- name: Build
run: pnpm build

- name: Test
run: pnpm test

publish:
needs: [build_test]
name: (only on release) Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/setup-engines

- name: Publish
if: success()
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
38 changes: 38 additions & 0 deletions .github/workflows/publish_prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: publish prerelease

on: [workflow_dispatch]

jobs:
build_test:
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v4

- uses: ./.github/actions/setup-engines

- name: Build
run: pnpm build

- name: Test
run: pnpm test

publish:
needs: [build_test]
name: (only on release) Publish (pre-release)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/setup-engines

- name: Pack package
if: success()
run: npm pack

- name: Publish
if: success()
run: npm publish --tag next
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__tests__

0 comments on commit 09ca78f

Please sign in to comment.