From acb8a1707adf418a6b9b8aadf0db084dd9923dc1 Mon Sep 17 00:00:00 2001 From: Aotokitsuruya Date: Thu, 14 Nov 2024 19:47:00 +0800 Subject: [PATCH] ci: add publish action Release-As: 0.1.0 --- .github/publish.yml | 21 +++++++++++++++++++++ .github/workflows/main.yml | 4 ++-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 .github/publish.yml diff --git a/.github/publish.yml b/.github/publish.yml new file mode 100644 index 0000000..ff8e3af --- /dev/null +++ b/.github/publish.yml @@ -0,0 +1,21 @@ +name: Publish to NPM.js +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + registry-url: 'https://registry.npmjs.org' + - run: yarn install --frozen-lockfile + - run: yarn publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 62a2133..4ed3b2e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,10 +22,10 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 - cache: 'npm' + cache: 'yarn' - name: Install dependencies - run: npm install + run: yarn install --frozen-lockfile - name: Build run: npx turbo run build