From 09f2bcd4d0ae47c2b47467bc4591017a9b90230e Mon Sep 17 00:00:00 2001 From: Jannis R Date: Wed, 17 Jan 2024 21:16:40 +0100 Subject: [PATCH] =?UTF-8?q?CI:=20test,=20build=20&=20publish=20npm=20packa?= =?UTF-8?q?ge=20=F0=9F=92=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/publish.yml | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..57ac8b1 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,36 @@ +name: build & publish to npm + +on: + schedule: + # 10th of the month, at 14:01 + - cron: '1 14 10 * *' + +jobs: + test-build-publish: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: ['16'] + + steps: + - name: checkout + uses: actions/checkout@v4 + - name: setup Node v${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + + - run: npm run build + - run: npm test + + - name: npm login + env: + NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} + run: npm set "//registry.npmjs.org/:_authToken=$NPM_TOKEN" + - name: bump version + run: | + set -x + npm version --no-git-tag-version --force "$(npm exec -- semver@7 -i minor "$(npm info "$(jq -r .name package.json)" version)")" + - name: publish + run: npm publish