diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 6d5ce05..ec7816f 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -16,6 +16,26 @@ jobs: with: node-version: 12 registry-url: https://registry.npmjs.org/ + + - name: Set env + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + + - run: | + sudo apt update + sudo apt install jq -y + + - run: | + git config --local user.email "melvin.vermeer@gmail.com" + git config --local user.name "Melvin Vermeer [ci]" + git fetch + git checkout main + jq --arg version ${{ env.RELEASE_VERSION }} '.version = $version' package.json > package.json.tmp + mv package.json.tmp package.json + git add package.json + git commit --no-verify -m "update package version ${{ env.RELEASE_VERSION }} [skip ci]" + - run: npm publish env: NODE_AUTH_TOKEN: ${{secrets.npm_token}} + + - run: git push origin main --no-verify