Compare commits

...
12 Commits
Author SHA1 Message Date
Carlos Alexandro Becker f06c13b6b1 chore: update dist
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2026-06-27 14:51:50 -03:00
Carlos Alexandro Becker d3934597ca ci: fix job
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2026-06-27 14:48:55 -03:00
Carlos Alexandro Becker ee731b1700 chore: workflow dispatch
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2026-06-27 14:04:48 -03:00
Carlos Alexandro Becker 55de448558 chore(deps): bump js-yaml from 4.1.1 to 4.2.0
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2026-06-27 14:03:18 -03:00
a4f614e65e ci: use a GitHub App token to rebuild dist on dependabot PRs (#569)
* ci: use a GitHub App token to rebuild dist on dependabot PRs

Replaces GH_PAT (a broad org PAT) with a GitHub App token for pushing the
rebuilt dist/ back to Dependabot PR branches. An App token is scoped to
this repo with minimal permissions and is short-lived, so it is much safer
to expose on the (semi-trusted) Dependabot PR build than a wide PAT.

The job stays a no-op until the DIST_REBUILD_APP_ID and
DIST_REBUILD_APP_PRIVATE_KEY Dependabot secrets are configured.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* ci: use GORELEASER_APP_ID/GORELEASER_APP_KEY for dist rebuild

Use the existing GoReleaser GitHub App secrets instead of dedicated
DIST_REBUILD_* ones.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-27 10:26:46 -03:00
d2d17a6c5d ci: auto-rebuild dist on dependabot PRs (#568)
Adds a workflow that, on Dependabot PRs, rebuilds the ncc-bundled dist/
and pushes it back onto the PR branch, so a dependency bump and its
matching dist/ land in a single PR and the validate workflow stays green.

Pushing the dist commit uses GH_PAT (the default GITHUB_TOKEN is read-only
on Dependabot runs and its pushes do not re-trigger checks). The job is a
no-op until GH_PAT is available as a Dependabot secret.

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-24 11:40:21 -03:00
d13def3a6e build: regenerate dist after undici 6.27.0 bump (#567)
The undici 6.24.1 -> 6.27.0 bump (#565) updated package-lock.json but
did not regenerate the bundled dist/index.js. The validate workflow's
build job rebuilds dist/ and fails on any uncommitted changes, which
broke CI on master.

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-24 10:43:30 -03:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
21549b6bea chore(deps): bump undici from 6.24.1 to 6.27.0 (#565)
Bumps [undici](https://github.com/nodejs/undici) from 6.24.1 to 6.27.0.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v6.24.1...v6.27.0)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 6.27.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-24 08:53:51 -03:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
47c416d5e8 ci(deps): bump the actions group with 3 updates (#563)
Bumps the actions group with 3 updates: [actions/checkout](https://github.com/actions/checkout), [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) and [codecov/codecov-action](https://github.com/codecov/codecov-action).


Updates `actions/checkout` from 6.0.2 to 6.0.3
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/de0fac2e4500dabe0009e67214ff5f5447ce83dd...df4cb1c069e1874edd31b4311f1884172cec0e10)

Updates `sigstore/cosign-installer` from 4.1.1 to 4.1.2
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](https://github.com/sigstore/cosign-installer/compare/cad07c2e89fa2edd6e2d7bab4c1aa38e53f76003...6f9f17788090df1f26f669e9d70d6ae9567deba6)

Updates `codecov/codecov-action` from 6.0.0 to 6.0.1
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/57e3a136b779b570ffcdbf80b3bdc90e7fab3de2...e79a6962e0d4c0c17b229090214935d2e33f8354)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: sigstore/cosign-installer
  dependency-version: 4.1.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: codecov/codecov-action
  dependency-version: 6.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-04 23:10:52 -03:00
CopilotGitHubcopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
5daf1e915a fix: nightly resolution to select newest published release (#562)
* fix(nightly): pick latest nightly by published_at

GitHub's /releases endpoint is not reliably ordered by published_at,
so resolveNightly could pick an older nightly than the most recent
one. Filter, sort by published_at desc, and take the first.

* test(nightly): add regression coverage for release ordering

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-05-18 21:38:28 -03:00
Carlos Alexandro Becker 5cc7ebb73d ci: update actions
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2026-05-02 13:23:47 -03:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
702f5f91c9 ci(deps): bump the actions group with 3 updates (#560)
Bumps the actions group with 3 updates: [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer), [actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/setup-node](https://github.com/actions/setup-node).


Updates `sigstore/cosign-installer` from 3.9.2 to 4.1.1
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](https://github.com/sigstore/cosign-installer/compare/d58896d6a1865668819e1d91763c7751a165e159...cad07c2e89fa2edd6e2d7bab4c1aa38e53f76003)

Updates `actions/upload-artifact` from 7.0.0 to 7.0.1
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/bbbca2ddaa5d8feaa63e36b76fdaad77386f024f...043fb46d1a93c77aae656e7c1c64a875d1fc6a0a)

Updates `actions/setup-node` from 5.0.0 to 6.4.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/a0853c24544627f65ddf259abe73b1d18a591444...48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-version: 4.1.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: actions/setup-node
  dependency-version: 6.4.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-02 12:25:51 -03:00
9 changed files with 118 additions and 143 deletions
+35 -63
View File
@@ -37,25 +37,21 @@ jobs:
- goreleaser - goreleaser
- goreleaser-pro - goreleaser-pro
steps: steps:
- - name: Checkout
name: Checkout uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: with:
fetch-depth: 0 fetch-depth: 0
- - name: Set up Go
name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with: with:
go-version: stable go-version: stable
- - name: Check
name: Check
uses: ./ uses: ./
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
args: check --verbose args: check --verbose
workdir: ./test workdir: ./test
- - name: GoReleaser
name: GoReleaser
if: ${{ !(github.event_name == 'pull_request' && matrix.distribution == 'goreleaser-pro') }} if: ${{ !(github.event_name == 'pull_request' && matrix.distribution == 'goreleaser-pro') }}
uses: ./ uses: ./
env: env:
@@ -81,30 +77,25 @@ jobs:
- true - true
- false - false
steps: steps:
- - name: Checkout
name: Checkout uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: with:
fetch-depth: 0 fetch-depth: 0
- - name: Set up Go
name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with: with:
go-version: 1.18 go-version: 1.18
- - name: Install cosign
name: Install cosign
if: matrix.cosign if: matrix.cosign
uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2 uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
- - name: GoReleaser
name: GoReleaser
if: ${{ !(github.event_name == 'pull_request' && matrix.distribution == 'goreleaser-pro') }} if: ${{ !(github.event_name == 'pull_request' && matrix.distribution == 'goreleaser-pro') }}
uses: ./ uses: ./
with: with:
distribution: ${{ matrix.distribution }} distribution: ${{ matrix.distribution }}
version: ${{ matrix.version }} version: ${{ matrix.version }}
install-only: true install-only: true
- - name: Check
name: Check
if: ${{ !(github.event_name == 'pull_request' && matrix.distribution == 'goreleaser-pro') }} if: ${{ !(github.event_name == 'pull_request' && matrix.distribution == 'goreleaser-pro') }}
run: | run: |
goreleaser check --verbose goreleaser check --verbose
@@ -120,25 +111,21 @@ jobs:
- macos-latest - macos-latest
- windows-latest - windows-latest
steps: steps:
- - name: Checkout
name: Checkout uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: with:
fetch-depth: 0 fetch-depth: 0
- - name: Set up Go
name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with: with:
go-version: 1.18 go-version: 1.18
- - name: Import GPG key
name: Import GPG key
id: import_gpg id: import_gpg
uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0 uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0
with: with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY_TEST }} gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY_TEST }}
passphrase: ${{ secrets.PASSPHRASE_TEST }} passphrase: ${{ secrets.PASSPHRASE_TEST }}
- - name: Check
name: Check
uses: ./ uses: ./
with: with:
version: latest version: latest
@@ -146,8 +133,7 @@ jobs:
workdir: ./test workdir: ./test
env: env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
- - name: GoReleaser
name: GoReleaser
uses: ./ uses: ./
with: with:
version: latest version: latest
@@ -159,31 +145,26 @@ jobs:
upload-artifact: upload-artifact:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- - name: Checkout
name: Checkout uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: with:
fetch-depth: 0 fetch-depth: 0
- - name: Set up Go
name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with: with:
go-version: 1.18 go-version: 1.18
- - name: Check
name: Check
uses: ./ uses: ./
with: with:
args: check --verbose args: check --verbose
workdir: ./test workdir: ./test
- - name: GoReleaser
name: GoReleaser
uses: ./ uses: ./
with: with:
args: release --skip=publish --clean --snapshot args: release --skip=publish --clean --snapshot
workdir: ./test workdir: ./test
- - name: Upload assets
name: Upload assets uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with: with:
name: myapp name: myapp
path: ./test/dist/* path: ./test/dist/*
@@ -191,24 +172,20 @@ jobs:
dist: dist:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- - name: Checkout
name: Checkout uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: with:
fetch-depth: 0 fetch-depth: 0
- - name: Set up Go
name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with: with:
go-version: 1.18 go-version: 1.18
- - name: GoReleaser
name: GoReleaser
uses: ./ uses: ./
with: with:
args: release --config .goreleaser-dist.yml --skip=publish --clean --snapshot args: release --config .goreleaser-dist.yml --skip=publish --clean --snapshot
workdir: ./test workdir: ./test
- - name: Check dist
name: Check dist
run: | run: |
tree -nh ./test/_output tree -nh ./test/_output
@@ -225,18 +202,15 @@ jobs:
- goreleaser-pro - goreleaser-pro
- goreleaser - goreleaser
steps: steps:
- - name: Checkout
name: Checkout uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: with:
fetch-depth: 0 fetch-depth: 0
- - name: Set up Go
name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with: with:
go-version: 1.18 go-version: 1.18
- - name: GoReleaser
name: GoReleaser
uses: ./ uses: ./
with: with:
install-only: true install-only: true
@@ -244,10 +218,8 @@ jobs:
version: nightly version: nightly
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- - name: Check
name: Check
run: | run: |
goreleaser check -f ./test/.goreleaser.yml goreleaser check -f ./test/.goreleaser.yml
goreleaser --version goreleaser --version
goreleaser --version | grep nightly goreleaser --version | grep nightly
+5 -9
View File
@@ -28,19 +28,15 @@ jobs:
tag: tag:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- - name: Checkout
name: Checkout uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: with:
fetch-depth: 0 fetch-depth: 0
- - name: Git config
name: Git config
run: | run: |
git config user.name "github-actions[bot]" git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- - name: Move ${{ github.event.inputs.major_version }} to ${{ github.event.inputs.target }}
name: Move ${{ github.event.inputs.major_version }} to ${{ github.event.inputs.target }}
run: git tag -f ${{ github.event.inputs.major_version }} ${{ github.event.inputs.target }} run: git tag -f ${{ github.event.inputs.major_version }} ${{ github.event.inputs.target }}
- - name: Push
name: Push
run: git push origin ${{ github.event.inputs.major_version }} --force run: git push origin ${{ github.event.inputs.major_version }} --force
+10 -16
View File
@@ -19,30 +19,24 @@ jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- - name: Checkout
name: Checkout uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: with:
fetch-depth: 0 fetch-depth: 0
- - name: Setup Node.js
name: Setup Node.js uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v6.0.0
with: with:
node-version-file: '.node-version' node-version-file: '.node-version'
cache: npm cache: npm
- - name: Install cosign
name: Install cosign uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2 - name: Install dependencies
-
name: Install dependencies
run: npm ci run: npm ci
- - name: Test
name: Test
run: npm test run: npm test
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- - name: Upload coverage
name: Upload coverage uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with: with:
files: ./coverage/clover.xml files: ./coverage/clover.xml
+22 -37
View File
@@ -19,45 +19,35 @@ jobs:
lint: lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- - name: Checkout
name: Checkout uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Setup Node.js
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
name: Setup Node.js
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v6.0.0
with: with:
node-version-file: '.node-version' node-version-file: '.node-version'
cache: npm cache: npm
- - name: Install dependencies
name: Install dependencies
run: npm ci run: npm ci
- - name: Format check
name: Format check
run: npm run format-check run: npm run format-check
- - name: Lint
name: Lint
run: npm run lint run: npm run lint
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- - name: Checkout
name: Checkout uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Setup Node.js
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.0.0
name: Setup Node.js
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v6.0.0
with: with:
node-version-file: '.node-version' node-version-file: '.node-version'
cache: npm cache: npm
- - name: Install dependencies
name: Install dependencies
run: npm ci --ignore-scripts run: npm ci --ignore-scripts
- - name: Rebuild dist
name: Rebuild dist
run: npm run build run: npm run build
- - name: Compare dist
name: Compare dist
id: diff id: diff
run: | run: |
if [ "$(git diff --ignore-space-at-eol dist | wc -l)" -gt "0" ]; then if [ "$(git diff --ignore-space-at-eol dist | wc -l)" -gt "0" ]; then
@@ -65,10 +55,9 @@ jobs:
git diff dist git diff dist
exit 1 exit 1
fi fi
- - name: Upload built dist on failure
name: Upload built dist on failure
if: ${{ failure() && steps.diff.conclusion == 'failure' }} if: ${{ failure() && steps.diff.conclusion == 'failure' }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with: with:
name: dist name: dist
path: dist path: dist
@@ -76,20 +65,16 @@ jobs:
vendor: vendor:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- - name: Checkout
name: Checkout uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Setup Node.js
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.0.0
name: Setup Node.js
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v6.0.0
with: with:
node-version-file: '.node-version' node-version-file: '.node-version'
cache: npm cache: npm
- - name: Refresh package-lock.json
name: Refresh package-lock.json
run: npm install --package-lock-only run: npm install --package-lock-only
- - name: Compare package-lock.json
name: Compare package-lock.json
run: | run: |
if [ -n "$(git status --porcelain -- package-lock.json)" ]; then if [ -n "$(git status --porcelain -- package-lock.json)" ]; then
echo "package-lock.json is out of sync with package.json. Run 'npm install' and commit." >&2 echo "package-lock.json is out of sync with package.json. Run 'npm install' and commit." >&2
+13
View File
@@ -104,3 +104,16 @@ describe('getRelease', () => {
); );
}); });
}); });
describe('latestNightlyRelease', () => {
it('returns the newest nightly by published_at even when API order is wrong', () => {
const release = github.latestNightlyRelease([
{tag_name: 'v2.16.0-c9b458fa-nightly', published_at: '2026-05-12T01:27:50Z'},
{tag_name: 'v2.16.0-6724de64-nightly', published_at: '2026-05-13T01:32:53Z'},
{tag_name: 'v2.16.0-2827930b-nightly', published_at: '2026-05-17T01:34:11Z'},
{tag_name: 'v2.15.4', published_at: '2026-04-21T14:07:57Z'}
]);
expect(release?.tag_name).toEqual('v2.16.0-2827930b-nightly');
});
});
Generated Vendored
+6 -8
View File
File diff suppressed because one or more lines are too long
+17 -7
View File
@@ -11,7 +11,7 @@
"@actions/exec": "^3.0.0", "@actions/exec": "^3.0.0",
"@actions/http-client": "^4.0.0", "@actions/http-client": "^4.0.0",
"@actions/tool-cache": "^4.0.0", "@actions/tool-cache": "^4.0.0",
"js-yaml": "^4.1.1", "js-yaml": "^4.2.0",
"semver": "^7.7.4", "semver": "^7.7.4",
"yargs": "^18.0.0" "yargs": "^18.0.0"
}, },
@@ -4217,9 +4217,19 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/js-yaml": { "node_modules/js-yaml": {
"version": "4.1.1", "version": "4.3.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz",
"integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", "integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/puzrin"
},
{
"type": "github",
"url": "https://github.com/sponsors/nodeca"
}
],
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"argparse": "^2.0.1" "argparse": "^2.0.1"
@@ -5609,9 +5619,9 @@
} }
}, },
"node_modules/undici": { "node_modules/undici": {
"version": "6.24.1", "version": "6.27.0",
"resolved": "https://registry.npmjs.org/undici/-/undici-6.24.1.tgz", "resolved": "https://registry.npmjs.org/undici/-/undici-6.27.0.tgz",
"integrity": "sha512-sC+b0tB1whOCzbtlx20fx3WgCXwkW627p4EA9uM+/tNNPkSS+eSEld6pAs9nDv7WbY1UUljBMYPtu9BCOrCWKA==", "integrity": "sha512-YmfV3YnEDzXRC5lZ2jWtWWHKGUm1zIt8AhesR1tens+HTNv+YZlN/dp6G727LOvMJ8xjP9Be7Y2Sdr96LDm+pg==",
"license": "MIT", "license": "MIT",
"engines": { "engines": {
"node": ">=18.17" "node": ">=18.17"
+1 -2
View File
@@ -23,13 +23,12 @@
], ],
"author": "CrazyMax", "author": "CrazyMax",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^3.0.0", "@actions/core": "^3.0.0",
"@actions/exec": "^3.0.0", "@actions/exec": "^3.0.0",
"@actions/http-client": "^4.0.0", "@actions/http-client": "^4.0.0",
"@actions/tool-cache": "^4.0.0", "@actions/tool-cache": "^4.0.0",
"js-yaml": "^4.1.1", "js-yaml": "^4.2.0",
"semver": "^7.7.4", "semver": "^7.7.4",
"yargs": "^18.0.0" "yargs": "^18.0.0"
}, },
+9 -1
View File
@@ -28,6 +28,7 @@ const withRetry = async <T>(operation: () => Promise<T>): Promise<T> => {
export interface GitHubRelease { export interface GitHubRelease {
tag_name: string; tag_name: string;
published_at?: string;
} }
// Matches the new-style nightly release tag pattern: vX.Y.Z-<sha>-nightly // Matches the new-style nightly release tag pattern: vX.Y.Z-<sha>-nightly
@@ -37,6 +38,13 @@ export const isNightlyTag = (tag: string): boolean => {
return nightlyTagRegex.test(tag); return nightlyTagRegex.test(tag);
}; };
export const latestNightlyRelease = (releases: Array<GitHubRelease>): GitHubRelease | undefined => {
return releases
.filter(r => nightlyTagRegex.test(r.tag_name))
.sort((a, b) => (b.published_at || '').localeCompare(a.published_at || ''))
.shift();
};
export const getRelease = async (distribution: string, version: string): Promise<GitHubRelease> => { export const getRelease = async (distribution: string, version: string): Promise<GitHubRelease> => {
if (version === 'latest') { if (version === 'latest') {
core.warning("You are using 'latest' as default version. Will lock to '~> v2'."); core.warning("You are using 'latest' as default version. Will lock to '~> v2'.");
@@ -113,7 +121,7 @@ const resolveNightly = async (distribution: string): Promise<GitHubRelease> => {
return <Array<GitHubRelease>>JSON.parse(body); return <Array<GitHubRelease>>JSON.parse(body);
}); });
const match = releases.find(r => nightlyTagRegex.test(r.tag_name)); const match = latestNightlyRelease(releases);
if (!match) { if (!match) {
throw new Error(`No '<version>-<sha>-nightly' release found in ${url}`); throw new Error(`No '<version>-<sha>-nightly' release found in ${url}`);
} }