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": {