diff --git a/.github/actions/setup-engines/action.yml b/.github/actions/setup-engines/action.yml index a4771bc..32dbd19 100644 --- a/.github/actions/setup-engines/action.yml +++ b/.github/actions/setup-engines/action.yml @@ -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 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..1537fa1 --- /dev/null +++ b/.github/workflows/publish.yml @@ -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 }} diff --git a/.github/workflows/publish_prerelease.yml b/.github/workflows/publish_prerelease.yml new file mode 100644 index 0000000..5894263 --- /dev/null +++ b/.github/workflows/publish_prerelease.yml @@ -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 }} diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..c912533 --- /dev/null +++ b/.npmignore @@ -0,0 +1 @@ +__tests__