From 13f748a2d79efff245d279c3e50b6e8113978029 Mon Sep 17 00:00:00 2001 From: Sergey Krylov Date: Thu, 4 Apr 2024 07:01:48 +0300 Subject: [PATCH] feat: add git publishing action --- .github/workflows/github-actions.yml | 4 +++- .github/workflows/publishing.yml | 20 ++++++++++++++++++++ .yarnrc.yml | 4 ++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publishing.yml diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index e249519..585fcb6 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -1,5 +1,7 @@ name: Test -run-name: ${{ github.actor }} 🚀 +run-name: Linting and typechecking 🚀 +env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} on: push: pull_request: diff --git a/.github/workflows/publishing.yml b/.github/workflows/publishing.yml new file mode 100644 index 0000000..50482cc --- /dev/null +++ b/.github/workflows/publishing.yml @@ -0,0 +1,20 @@ +name: Publish Package +run-name: Publishing Package to npmjs registry +env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} +on: + release: + types: [published] +jobs: + publishing: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'yarn' + registry-url: 'https://registry.npmjs.org' + - run: yarn + - run: yarn npm publish diff --git a/.yarnrc.yml b/.yarnrc.yml index ebe8f83..be769a9 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -1,3 +1,7 @@ nodeLinker: node-modules yarnPath: .yarn/releases/yarn-4.1.1.cjs + +npmPublishRegistry: "https://registry.npmjs.org" + +npmAuthToken: ${NODE_AUTH_TOKEN || ""}