Skip to content

Use npm trusted publishing #1394

Use npm trusted publishing

Use npm trusted publishing #1394

Workflow file for this run

name: Build and test
on:
push:
branches: [main, release-**]
pull_request:
branches: [main, release-**]
workflow_dispatch:
jobs:
build:
# prevent from running on forks
if: github.repository_owner == 'restatedev'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: "https://registry.npmjs.org"
- uses: pnpm/action-setup@v4
with:
version: 10.13.1
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v2.x
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: pnpm install --frozen-lockfile
- run: pnpm build
# - run: pnpm verify
- run: pnpm pack --filter "./packages/libs/**" --pack-destination .
- run: find -type f -name "restatedev-restate-sdk-[0-9.]*\.tgz" | xargs -I {} mv {} restatedev-restate-sdk.tgz
- run: find -type f -name "restatedev-restate-sdk-clients-[0-9.]*\.tgz" | xargs -I {} mv {} restatedev-restate-sdk-clients.tgz
- run: find -type f -name "restatedev-restate-sdk-core-[0-9.]*\.tgz" | xargs -I {} mv {} restatedev-restate-sdk-core.tgz
- uses: actions/upload-artifact@v4
with:
name: restatedev-restate-sdk
path: restatedev-restate-sdk.tgz
retention-days: 1
if-no-files-found: error
- uses: actions/upload-artifact@v4
with:
name: restatedev-restate-sdk-clients
path: restatedev-restate-sdk-clients.tgz
retention-days: 1
if-no-files-found: error
- uses: actions/upload-artifact@v4
with:
name: restatedev-restate-sdk-core
path: restatedev-restate-sdk-core.tgz
retention-days: 1
if-no-files-found: error
publish-snapshot:
needs: build
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
permissions:
contents: read
id-token: write
uses: ./.github/workflows/publish.yml
with:
snapshot: true