From 403cb5ebf65d18c375cb7fdf350d3265419245ec Mon Sep 17 00:00:00 2001 From: Oscar Franco Date: Mon, 21 Oct 2024 10:09:22 +0200 Subject: [PATCH] Add update publish --- .github/workflows/publish.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 13318e0..1a6a9be 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -26,10 +26,14 @@ jobs: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} ${{ runner.os }}-yarn- - run: yarn install + - name: Update package.json version + run: | + git fetch --tags + TAG=$(git describe --tags `git rev-list --tags --max-count=1`) + jq --arg version "$TAG" '.version = $version' package.json > tmp.$$.json && mv tmp.$$.json package.json - uses: JS-DevTools/npm-publish@v3 with: token: ${{ secrets.NPM_TOKEN }} - registry: "https://npm.pkg.github.com" - name: Create a Release uses: elgohr/Github-Release-Action@v5 env: