diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6d63590..201cca3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,6 +16,9 @@ jobs: - run: yarn - run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc + - name: Fetch tags from git history + run: git fetch --unshallow --tags + - name: Extract version from package.json id: package_version run: echo "VERSION=$(jq -r .version package.json)" >> $GITHUB_ENV @@ -26,16 +29,22 @@ jobs: VERSION=${{ env.VERSION }} echo "Searching for version: $VERSION in CHANGELOG.md" - CHANGELOG_OUTPUT=$(npx auto-changelog --stdout) + CHANGELOG_OUTPUT=$(yarn changelog --stdout) NOTES=$(echo "$CHANGELOG_OUTPUT" | awk "/\/${VERSION//./\\.} \(/ {print; flag=1; next} /^solidity-utils\// {flag=0} flag") + echo "$NOTES" + if [ -z "$NOTES" ]; then echo "❌ No changelog entry found for version $VERSION" echo "Use: yarn changelog" exit 1 fi - echo "::set-output name=notes::$NOTES" + { + echo "notes<> "$GITHUB_OUTPUT" shell: bash