From 51da5e35f1ef9586947d89e1278c1979a25081c9 Mon Sep 17 00:00:00 2001 From: jmd3v Date: Thu, 14 Dec 2023 15:56:51 -0300 Subject: [PATCH] chore: add release action --- .github/workflows/release-package.yml | 42 +++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release-package.yml diff --git a/.github/workflows/release-package.yml b/.github/workflows/release-package.yml new file mode 100644 index 0000000..7b272ef --- /dev/null +++ b/.github/workflows/release-package.yml @@ -0,0 +1,42 @@ +name: Squid Types Release + +on: + push: + branches: + - main + +jobs: + release: + name: Release Squid Types package + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: "18" + + - name: Authenticate with private NPM package + run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc + + - name: Install dependencies + run: | + yarn install + yarn build + + - name: Setup git profile + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + + - name: Publish to NPM + id: publish + uses: JS-DevTools/npm-publish@v2 + if: ${{ github.event.inputs.npm-release == 'true' }} + with: + token: ${{ secrets.NPM_TOKEN }} + package: "./package.json" + dry-run: ${{ github.event.inputs.dry-run }} + + - if: ${{ github.event.inputs.npm-release == 'true' && steps.publish.outputs.type != 'none' && github.event.inputs.dry-run == 'false'}} + run: | + echo "Version changed: ${{ steps.publish.outputs.old-version }} => ${{ steps.publish.outputs.version }}" diff --git a/package.json b/package.json index 52a29e6..cf3dc1b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@0xsquid/squid-types", - "version": "0.1.", + "version": "0.1.43", "description": "JS and TS types relating to 0xsquid related projects.", "main": "dist/index.js", "types": "./dist/index.d.ts",