From 01cc082351ee2a03c6cc3f68bc7d6e31ca2bbcef Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Sun, 26 Jul 2026 13:33:59 -0700 Subject: [PATCH] release 3.1.1 --- .github/workflows/release.yml | 20 +++++++++++++++++--- CHANGELOG.md | 4 ++-- package.json | 2 +- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 92f4737..4741b65 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,13 +17,23 @@ jobs: steps: - uses: actions/checkout@v6 with: - fetch-depth: 2 # last 2 commits + fetch-depth: 0 # need every commit in the pushed range - name: check version change id: check + env: + BEFORE: ${{ github.event.before }} run: | - PREV_VERSION=$(git show HEAD^:package.json | jq -r .version) CURR_VERSION=$(jq -r .version package.json) - echo "Previous: $PREV_VERSION" + # Compare against where the branch pointed before this push + if [ -z "$BEFORE" ] \ + || [ "$BEFORE" = "0000000000000000000000000000000000000000" ] \ + || ! git cat-file -e "$BEFORE^{commit}" 2>/dev/null; then + # New branch, force push, or a baseline that no longer exists: + PREV_VERSION="" + else + PREV_VERSION=$(git show "$BEFORE:package.json" | jq -r .version) + fi + echo "Previous: ${PREV_VERSION:-}" echo "Current: $CURR_VERSION" if [ "$PREV_VERSION" != "$CURR_VERSION" ]; then echo "changed=true" >> $GITHUB_OUTPUT @@ -51,6 +61,9 @@ jobs: runs-on: ubuntu-latest permissions: contents: write # needed to create tags and releases + outputs: + # Exposed so publish can skip an already-released version + tagged: ${{ steps.tag-check.outputs.exists == 'false' }} steps: - uses: actions/checkout@v6 with: @@ -80,6 +93,7 @@ jobs: publish: needs: release + if: needs.release.outputs.tagged == 'true' runs-on: ubuntu-latest permissions: contents: read diff --git a/CHANGELOG.md b/CHANGELOG.md index 69d228c..ce64db5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). ### Unreleased -### [3.1.0] - 2026-07-26 +### [3.1.1] - 2026-07-26 - chore: declare Node.js 22 as the floor - feat(packet): Extended DNS Errors (RFC 8914) — `Packet.EDE` INFO-CODEs, an EDE @@ -109,4 +109,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). [2.3.0]: https://github.com/lsongdev/node-dns/releases/tag/v2.3.0 [2.2.0]: https://github.com/lsongdev/node-dns/releases/tag/v2.2.0 [2.2.1]: https://github.com/lsongdev/node-dns/releases/tag/v2.2.1 -[3.1.0]: https://github.com/lsongdev/node-dns/releases/tag/v3.1.0 +[3.1.1]: https://github.com/lsongdev/node-dns/releases/tag/v3.1.1 diff --git a/package.json b/package.json index fd3b0b7..8b6aae8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dns2", - "version": "3.1.0", + "version": "3.1.1", "description": "A DNS Server and Client Implementation in Pure JavaScript with no dependencies.", "main": "index.js", "types": "ts/index.d.ts",