From 8371a74ab54c1837f33ccb0ed93b1efce6f63fb7 Mon Sep 17 00:00:00 2001 From: Dmitry Chepurovskiy Date: Fri, 28 Jul 2023 12:41:13 +0300 Subject: [PATCH] Added publishing to github npm registry --- .github/workflows/publish.yaml | 41 ++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..9453748 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,41 @@ +name: Publish package + +on: + push: + tags: + - v*.*.* + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout + uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + registry-url: 'https://npm.pkg.github.com' + scope: ${{ github.repository_owner }} + + - name: Update package.json + run: | + TAG_NAME=${GITHUB_REF/refs\/tags\//} + PACKAGE_VERSION=${TAG_NAME#v} + echo "Updating package.json to version $PACKAGE_VERSION" + cat <<< $(jq -r ".version=\"$PACKAGE_VERSION\"" package.json) > package.json + cat <<< $(jq -r ".name=\"@${{ github.repository }}\"" package.json) > package.json + cat package.json + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Build + run: yarn build + + - name: Publish + run: yarn publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index c44d9a8..f1ae76e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@1inch/permit-signed-approvals-utils", - "version": "1.4.8", + "version": "1.4.9", "description": "Utils library for EIP-2612: permit – 712-signed approvals", "main": "index.js", "scripts": {