diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 8906ab1..3b88040 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -1,5 +1,8 @@ name: Publish to NPM +permissions: + contents: write + on: push: branches: @@ -20,10 +23,13 @@ jobs: registry-url: 'https://registry.npmjs.org' scope: '@haloivanid' - - name: Install dependencies - run: npm ci + - name: Install semantic-release + run: npm i -g semantic-release - - run: npm i -g semantic-release + - name: Set up Yarn + uses: borales/actions-yarn@v4 + with: + cmd: install - name: Build lib folder run: ./build.sh @@ -33,4 +39,5 @@ jobs: cd lib npx semantic-release env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/build.sh b/build.sh index f3564d0..bde0488 100755 --- a/build.sh +++ b/build.sh @@ -6,4 +6,4 @@ mkdir ./lib yarn build cp ./package.lib.json ./lib/package.json -echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/lib/.npmrc +echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ./lib/.npmrc