Compare commits

..
2 Commits
Author SHA1 Message Date
Carlos Alexandro Becker b4b0533a52 Merge remote-tracking branch 'origin/master' into semver
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-05-08 16:11:17 -03:00
Carlos Alexandro Becker b885aa77a9 feat: warn about using 'latest' 2024-04-27 12:13:40 -03:00
31 changed files with 6465 additions and 6273 deletions
+4 -2
View File
@@ -1,2 +1,4 @@
/dist/** linguist-generated=true -diff /.yarn/releases/** binary
/lib/** linguist-generated=true -diff /.yarn/plugins/** binary
/dist/** linguist-generated=true
/lib/** linguist-generated=true
+6 -16
View File
@@ -3,28 +3,18 @@ updates:
- package-ecosystem: "github-actions" - package-ecosystem: "github-actions"
directory: "/" directory: "/"
schedule: schedule:
interval: monthly interval: "daily"
time: "06:00"
timezone: "Europe/Paris"
labels: labels:
- "dependencies" - "dependencies"
commit-message:
prefix: "ci"
include: "scope"
groups:
actions:
patterns:
- "*"
- package-ecosystem: "npm" - package-ecosystem: "npm"
directory: "/" directory: "/"
schedule: schedule:
interval: monthly interval: "daily"
time: "06:00"
timezone: "Europe/Paris"
allow: allow:
- dependency-type: "production" - dependency-type: "production"
labels: labels:
- "dependencies" - "dependencies"
commit-message:
prefix: "chore"
include: "scope"
groups:
npm:
patterns:
- "*"
+28 -34
View File
@@ -4,10 +4,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions:
contents: read
on: on:
schedule: schedule:
- cron: '0 10 * * *' - cron: '0 10 * * *'
@@ -28,32 +24,31 @@ jobs:
matrix: matrix:
os: os:
- ubuntu-latest - ubuntu-latest
- macos-latest - macOS-latest
- windows-latest - windows-latest
version: version:
- latest - latest
- '~> 2.6' - '~> 1.15'
- '~> 1.26'
distribution: distribution:
- goreleaser - goreleaser
- goreleaser-pro - goreleaser-pro
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- -
name: Set up Go name: Set up Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 uses: actions/setup-go@v5
with: with:
go-version: stable go-version: 1.18
- -
name: Check name: Check
uses: ./ uses: ./
with: with:
version: ${{ matrix.version }} version: ${{ matrix.version }}
args: check --verbose args: check --debug
workdir: ./test workdir: ./test
- -
name: GoReleaser name: GoReleaser
@@ -64,7 +59,7 @@ jobs:
with: with:
distribution: ${{ matrix.distribution }} distribution: ${{ matrix.distribution }}
version: ${{ matrix.version }} version: ${{ matrix.version }}
args: release --skip=publish --clean --snapshot args: release --skip-publish --clean --snapshot
workdir: ./test workdir: ./test
install-only: install-only:
@@ -74,20 +69,19 @@ jobs:
matrix: matrix:
version: version:
- latest - latest
- '~> 2.6' - '~> 0.166'
- '~> 1.26'
distribution: distribution:
- goreleaser - goreleaser
- goreleaser-pro - goreleaser-pro
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- -
name: Set up Go name: Set up Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 uses: actions/setup-go@v5
with: with:
go-version: 1.18 go-version: 1.18
- -
@@ -102,7 +96,7 @@ jobs:
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 --debug
signing: signing:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@@ -112,23 +106,23 @@ jobs:
matrix: matrix:
os: os:
- ubuntu-latest - ubuntu-latest
- macos-latest - macOS-latest
- windows-latest - windows-latest
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- -
name: Set up Go name: Set up Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 uses: actions/setup-go@v5
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@e89d40939c28e39f97cf32126055eeae86ba74ec # v6.3.0 uses: crazy-max/ghaction-import-gpg@v6
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 }}
@@ -137,7 +131,7 @@ jobs:
uses: ./ uses: ./
with: with:
version: latest version: latest
args: -f .goreleaser-signing.yml check --verbose args: -f .goreleaser-signing.yml check --debug
workdir: ./test workdir: ./test
env: env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
@@ -146,7 +140,7 @@ jobs:
uses: ./ uses: ./
with: with:
version: latest version: latest
args: -f .goreleaser-signing.yml release --skip=publish --clean --snapshot args: -f .goreleaser-signing.yml release --skip-publish --clean --snapshot
workdir: ./test workdir: ./test
env: env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
@@ -156,29 +150,29 @@ jobs:
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- -
name: Set up Go name: Set up Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 uses: actions/setup-go@v5
with: with:
go-version: 1.18 go-version: 1.18
- -
name: Check name: Check
uses: ./ uses: ./
with: with:
args: check --verbose args: check --debug
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@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 uses: actions/upload-artifact@v4
with: with:
name: myapp name: myapp
path: ./test/dist/* path: ./test/dist/*
@@ -188,19 +182,19 @@ jobs:
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- -
name: Set up Go name: Set up Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 uses: actions/setup-go@v5
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
@@ -214,7 +208,7 @@ jobs:
matrix: matrix:
os: os:
- ubuntu-latest - ubuntu-latest
- macos-latest - macOS-latest
- windows-latest - windows-latest
distribution: distribution:
- goreleaser-pro - goreleaser-pro
@@ -222,12 +216,12 @@ jobs:
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- -
name: Set up Go name: Set up Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 uses: actions/setup-go@v5
with: with:
go-version: 1.18 go-version: 1.18
- -
-46
View File
@@ -1,46 +0,0 @@
name: dependabot-build
on:
pull_request:
paths:
- 'package.json'
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
-
name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.head_ref }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
-
name: Vendor
uses: docker/bake-action@5be5f02ff8819ecd3092ea6b2e6261c31774f2b4 # v6.10.0
with:
targets: vendor
-
name: Pre-checkin
uses: docker/bake-action@5be5f02ff8819ecd3092ea6b2e6261c31774f2b4 # v6.10.0
with:
targets: pre-checkin
-
name: Commit and push changes
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
if git diff --cached --quiet; then
echo "No changes to commit"
else
git commit -m "chore: update dist and vendor"
git push
fi
+4 -9
View File
@@ -4,10 +4,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions:
contents: read
on: on:
push: push:
branches: branches:
@@ -21,17 +17,16 @@ jobs:
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- -
name: Test name: Test
uses: docker/bake-action@5be5f02ff8819ecd3092ea6b2e6261c31774f2b4 # v6.10.0 uses: docker/bake-action@v4
with: with:
source: .
targets: test targets: test
- -
name: Upload coverage name: Upload coverage
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 uses: codecov/codecov-action@v4
with: with:
files: ./coverage/clover.xml file: ./coverage/clover.xml
+10 -12
View File
@@ -4,10 +4,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions:
contents: read
on: on:
push: push:
branches: branches:
@@ -19,17 +15,16 @@ jobs:
prepare: prepare:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
targets: ${{ steps.generate.outputs.targets }} targets: ${{ steps.targets.outputs.matrix }}
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 uses: actions/checkout@v4
- -
name: List targets name: Targets matrix
id: generate id: targets
uses: docker/bake-action/subaction/list-targets@5be5f02ff8819ecd3092ea6b2e6261c31774f2b4 # v6.10.0 run: |
with: echo "matrix=$(docker buildx bake validate --print | jq -cr '.group.validate.targets')" >> $GITHUB_OUTPUT
target: validate
validate: validate:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -40,8 +35,11 @@ jobs:
matrix: matrix:
target: ${{ fromJson(needs.prepare.outputs.targets) }} target: ${{ fromJson(needs.prepare.outputs.targets) }}
steps: steps:
-
name: Checkout
uses: actions/checkout@v4
- -
name: Validate name: Validate
uses: docker/bake-action@5be5f02ff8819ecd3092ea6b2e6261c31774f2b4 # v6.10.0 uses: docker/bake-action@v4
with: with:
targets: ${{ matrix.target }} targets: ${{ matrix.target }}
+11 -1
View File
@@ -4,6 +4,8 @@
logs logs
*.log *.log
npm-debug.log* npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log* lerna-debug.log*
.pnpm-debug.log* .pnpm-debug.log*
@@ -33,6 +35,8 @@ jspm_packages/
# Optional eslint cache # Optional eslint cache
.eslintcache .eslintcache
# Yarn Integrity file
.yarn-integrity
# dotenv environment variable files # dotenv environment variable files
.env .env
@@ -40,4 +44,10 @@ jspm_packages/
.env.test.local .env.test.local
.env.production.local .env.production.local
.env.local .env.local
provenance.json
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
File diff suppressed because one or more lines are too long
+13
View File
@@ -0,0 +1,13 @@
logFilters:
- code: YN0013
level: discard
- code: YN0019
level: discard
- code: YN0076
level: discard
nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
+17 -17
View File
@@ -31,7 +31,7 @@ ___
## Usage ## Usage
GoReleaser Action runs [goreleaser][], please follow its [docs][gdocs] for GoReleaser Action runs [goreleaser][], please follow its [docs][gdocs] for
more information about how to customize what GoReleaser does. more information about how to customize what GoReleaser do.
[goreleaser]: https://goreleaser.com/ [goreleaser]: https://goreleaser.com/
[gdocs]: https://goreleaser.com/customization [gdocs]: https://goreleaser.com/customization
@@ -54,20 +54,20 @@ jobs:
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- -
name: Set up Go name: Set up Go
uses: actions/setup-go@v5 uses: actions/setup-go@v4
- -
name: Run GoReleaser name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6 uses: goreleaser/goreleaser-action@v5
with: with:
# either 'goreleaser' (default) or 'goreleaser-pro' # either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser distribution: goreleaser
# 'latest', 'nightly', or a semver # 'latest', 'nightly', or a semver
version: '~> v2' version: latest
args: release --clean args: release --clean
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -93,10 +93,10 @@ Or with a condition on GoReleaser step:
```yaml ```yaml
- -
name: Run GoReleaser name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6 uses: goreleaser/goreleaser-action@v5
if: startsWith(github.ref, 'refs/tags/') if: startsWith(github.ref, 'refs/tags/')
with: with:
version: '~> v2' version: latest
args: release --clean args: release --clean
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -119,9 +119,9 @@ the [Import GPG](https://github.com/crazy-max/ghaction-import-gpg) GitHub Action
passphrase: ${{ secrets.PASSPHRASE }} passphrase: ${{ secrets.PASSPHRASE }}
- -
name: Run GoReleaser name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6 uses: goreleaser/goreleaser-action@v5
with: with:
version: '~> v2' version: latest
args: release --clean args: release --clean
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -139,21 +139,21 @@ signs:
### Upload artifacts ### Upload artifacts
For some events like pull request or schedule you might want to store the artifacts somewhere for testing For some events like pull request or schedule you might want to store the artifacts somewhere for testing
purposes. You can do that with the [actions/upload-artifact](https://github.com/actions/upload-artifact) action: purpose. You can do that with the [actions/upload-artifact](https://github.com/actions/upload-artifact) action:
```yaml ```yaml
- -
name: Run GoReleaser name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6 uses: goreleaser/goreleaser-action@v5
with: with:
version: '~> v2' version: latest
args: release --clean args: release --clean
workdir: myfolder workdir: myfolder
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- -
name: Upload assets name: Upload assets
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3
with: with:
name: myapp name: myapp
path: myfolder/dist/* path: myfolder/dist/*
@@ -165,7 +165,7 @@ purposes. You can do that with the [actions/upload-artifact](https://github.com/
steps: steps:
- -
name: Install GoReleaser name: Install GoReleaser
uses: goreleaser/goreleaser-action@v6 uses: goreleaser/goreleaser-action@v5
with: with:
install-only: true install-only: true
- -
@@ -182,7 +182,7 @@ Following inputs can be used as `step.with` keys
| Name | Type | Default | Description | | Name | Type | Default | Description |
|------------------|---------|--------------|------------------------------------------------------------------| |------------------|---------|--------------|------------------------------------------------------------------|
| `distribution` | String | `goreleaser` | GoReleaser distribution, either `goreleaser` or `goreleaser-pro` | | `distribution` | String | `goreleaser` | GoReleaser distribution, either `goreleaser` or `goreleaser-pro` |
| `version`**¹** | String | `~> v2` | GoReleaser version | | `version`**¹** | String | `latest` | GoReleaser version |
| `args` | String | | Arguments to pass to GoReleaser | | `args` | String | | Arguments to pass to GoReleaser |
| `workdir` | String | `.` | Working directory (below repository root) | | `workdir` | String | `.` | Working directory (below repository root) |
| `install-only` | Bool | `false` | Just install GoReleaser | | `install-only` | Bool | `false` | Just install GoReleaser |
@@ -219,9 +219,9 @@ secret named `GH_PAT`, the step will look like this:
```yaml ```yaml
- -
name: Run GoReleaser name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6 uses: goreleaser/goreleaser-action@v5
with: with:
version: '~> v2' version: latest
args: release --clean args: release --clean
env: env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }} GITHUB_TOKEN: ${{ secrets.GH_PAT }}
+1 -43
View File
@@ -32,30 +32,6 @@ describe('getRelease', () => {
expect(release?.tag_name).not.toEqual(''); expect(release?.tag_name).not.toEqual('');
}); });
it('returns latest v1 GoReleaser Pro GitHub release', async () => {
const release = await github.getRelease('goreleaser-pro', '~> v1');
expect(release).not.toBeNull();
expect(release?.tag_name).not.toEqual('');
});
it('returns latest v1 GoReleaser GitHub release', async () => {
const release = await github.getRelease('goreleaser', '~> v1');
expect(release).not.toBeNull();
expect(release?.tag_name).not.toEqual('');
});
it('returns latest v2 GoReleaser Pro GitHub release', async () => {
const release = await github.getRelease('goreleaser-pro', '~> v2');
expect(release).not.toBeNull();
expect(release?.tag_name).not.toEqual('');
});
it('returns latest v2 GoReleaser GitHub release', async () => {
const release = await github.getRelease('goreleaser', '~> v2');
expect(release).not.toBeNull();
expect(release?.tag_name).not.toEqual('');
});
it('returns nightly GoReleaser GitHub release', async () => { it('returns nightly GoReleaser GitHub release', async () => {
const release = await github.getRelease('goreleaser', 'nightly'); const release = await github.getRelease('goreleaser', 'nightly');
expect(release).not.toBeNull(); expect(release).not.toBeNull();
@@ -80,27 +56,9 @@ describe('getRelease', () => {
expect(release?.tag_name).toEqual('v0.182.1-pro'); expect(release?.tag_name).toEqual('v0.182.1-pro');
}); });
it('returns v2.7.0 GoReleaser Pro GitHub release', async () => {
const release = await github.getRelease('goreleaser-pro', '~> v2.7');
expect(release).not.toBeNull();
expect(release?.tag_name).toEqual('v2.7.0');
});
it('skips JSON check for specific version v2.8.1', async () => {
const release = await github.getRelease('goreleaser', 'v2.8.1');
expect(release).not.toBeNull();
expect(release?.tag_name).toEqual('v2.8.1');
});
it('skips JSON check for specific version without v prefix', async () => {
const release = await github.getRelease('goreleaser', '2.8.1');
expect(release).not.toBeNull();
expect(release?.tag_name).toEqual('v2.8.1');
});
it('unknown GoReleaser Pro release', async () => { it('unknown GoReleaser Pro release', async () => {
await expect(github.getRelease('goreleaser-pro', 'foo')).rejects.toThrow( await expect(github.getRelease('goreleaser-pro', 'foo')).rejects.toThrow(
new Error('Cannot find GoReleaser release foo in https://goreleaser.com/static/releases-pro.json') new Error('Cannot find GoReleaser release foo-pro in https://goreleaser.com/static/releases-pro.json')
); );
}); });
}); });
-10
View File
@@ -28,16 +28,6 @@ describe('install', () => {
expect(fs.existsSync(bin)).toBe(true); expect(fs.existsSync(bin)).toBe(true);
}, 100000); }, 100000);
it('acquires latest v2 version of GoReleaser', async () => {
const bin = await goreleaser.install('goreleaser', '~> v2');
expect(fs.existsSync(bin)).toBe(true);
}, 100000);
it('acquires latest v2 version of GoReleaser Pro', async () => {
const bin = await goreleaser.install('goreleaser-pro', '~> v2');
expect(fs.existsSync(bin)).toBe(true);
}, 100000);
it('acquires latest version of GoReleaser Pro', async () => { it('acquires latest version of GoReleaser Pro', async () => {
const bin = await goreleaser.install('goreleaser-pro', 'latest'); const bin = await goreleaser.install('goreleaser-pro', 'latest');
expect(fs.existsSync(bin)).toBe(true); expect(fs.existsSync(bin)).toBe(true);
+2 -2
View File
@@ -13,7 +13,7 @@ inputs:
required: false required: false
version: version:
description: 'GoReleaser version' description: 'GoReleaser version'
default: '~> v2' default: 'latest'
required: false required: false
args: args:
description: 'Arguments to pass to GoReleaser' description: 'Arguments to pass to GoReleaser'
@@ -34,5 +34,5 @@ outputs:
description: 'Build result metadata' description: 'Build result metadata'
runs: runs:
using: 'node24' using: 'node20'
main: 'dist/index.js' main: 'dist/index.js'
+20 -9
View File
@@ -1,15 +1,22 @@
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
ARG NODE_VERSION=24 ARG NODE_VERSION=20
FROM node:${NODE_VERSION}-alpine AS base FROM node:${NODE_VERSION}-alpine AS base
RUN apk add --no-cache cpio findutils git RUN apk add --no-cache cpio findutils git
WORKDIR /src WORKDIR /src
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache <<EOT
corepack enable
yarn --version
yarn config set --home enableTelemetry 0
EOT
FROM base AS deps FROM base AS deps
RUN --mount=type=bind,target=.,rw \ RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache \
--mount=type=cache,target=/src/node_modules \ --mount=type=cache,target=/src/node_modules \
npm install && mkdir /vendor && cp package-lock.json /vendor yarn install && mkdir /vendor && cp yarn.lock /vendor
FROM scratch AS vendor-update FROM scratch AS vendor-update
COPY --from=deps /vendor / COPY --from=deps /vendor /
@@ -19,17 +26,18 @@ RUN --mount=type=bind,target=.,rw <<EOT
set -e set -e
git add -A git add -A
cp -rf /vendor/* . cp -rf /vendor/* .
if [ -n "$(git status --porcelain -- package-lock.json)" ]; then if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor"' echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor"'
git status --porcelain -- package-lock.json git status --porcelain -- yarn.lock
exit 1 exit 1
fi fi
EOT EOT
FROM deps AS build FROM deps AS build
RUN --mount=type=bind,target=.,rw \ RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache \
--mount=type=cache,target=/src/node_modules \ --mount=type=cache,target=/src/node_modules \
npm run build && mkdir /out && cp -Rf dist /out/ yarn run build && mkdir /out && cp -Rf dist /out/
FROM scratch AS build-update FROM scratch AS build-update
COPY --from=build /out / COPY --from=build /out /
@@ -48,24 +56,27 @@ EOT
FROM deps AS format FROM deps AS format
RUN --mount=type=bind,target=.,rw \ RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache \
--mount=type=cache,target=/src/node_modules \ --mount=type=cache,target=/src/node_modules \
npm run format \ yarn run format \
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' | cpio -pdm /out && mkdir /out && find . -name '*.ts' -not -path './node_modules/*' -not -path './.yarn/*' | cpio -pdm /out
FROM scratch AS format-update FROM scratch AS format-update
COPY --from=format /out / COPY --from=format /out /
FROM deps AS lint FROM deps AS lint
RUN --mount=type=bind,target=.,rw \ RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache \
--mount=type=cache,target=/src/node_modules \ --mount=type=cache,target=/src/node_modules \
npm run lint yarn run lint
FROM deps AS test FROM deps AS test
ENV RUNNER_TEMP=/tmp/github_runner ENV RUNNER_TEMP=/tmp/github_runner
ENV RUNNER_TOOL_CACHE=/tmp/github_tool_cache ENV RUNNER_TOOL_CACHE=/tmp/github_tool_cache
RUN --mount=type=bind,target=.,rw \ RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache \
--mount=type=cache,target=/src/node_modules \ --mount=type=cache,target=/src/node_modules \
npm run test -- --coverage --coverageDirectory=/tmp/coverage yarn run test --coverage --coverageDirectory=/tmp/coverage
FROM scratch AS test-coverage FROM scratch AS test-coverage
COPY --from=test /tmp/coverage / COPY --from=test /tmp/coverage /
Generated Vendored
+4 -37
View File
File diff suppressed because one or more lines are too long
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long
Generated Vendored
+141 -6
View File
@@ -71,11 +71,33 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@fastify/busboy
MIT
Copyright Brian White. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
ansi-regex ansi-regex
MIT MIT
MIT License MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com) Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@@ -88,7 +110,7 @@ ansi-styles
MIT MIT
MIT License MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com) Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@@ -115,6 +137,42 @@ WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
color-convert
MIT
Copyright (c) 2011-2016 Heather Arthur <fayearthur@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
color-name
MIT
The MIT License (MIT)
Copyright (c) 2015 Dmitry Ivanov
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
emoji-regex emoji-regex
MIT MIT
Copyright Mathias Bynens <https://mathiasbynens.be/> Copyright Mathias Bynens <https://mathiasbynens.be/>
@@ -162,11 +220,11 @@ Permission to use, copy, modify, and/or distribute this software for any purpose
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
get-east-asian-width is-fullwidth-code-point
MIT MIT
MIT License MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com) Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@@ -200,6 +258,51 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
lru-cache
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
require-directory
MIT
The MIT License (MIT)
Copyright (c) 2011 Troy Goode <troygoode@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
semver semver
ISC ISC
The ISC License The ISC License
@@ -223,7 +326,7 @@ string-width
MIT MIT
MIT License MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com) Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@@ -236,7 +339,7 @@ strip-ansi
MIT MIT
MIT License MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com) Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@@ -295,6 +398,19 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
uuid
MIT
The MIT License (MIT)
Copyright (c) 2010-2020 Robert Kieffer and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
wrap-ansi wrap-ansi
MIT MIT
MIT License MIT License
@@ -325,6 +441,25 @@ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE. THIS SOFTWARE.
yallist
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
yargs yargs
MIT MIT
MIT License MIT License
Generated Vendored
-3
View File
@@ -1,3 +0,0 @@
{
"type": "module"
}
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long
-8
View File
@@ -1,9 +1,3 @@
target "_common" {
args = {
BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
}
}
group "default" { group "default" {
targets = ["build"] targets = ["build"]
} }
@@ -23,7 +17,6 @@ target "build" {
} }
target "build-validate" { target "build-validate" {
inherits = ["_common"]
dockerfile = "dev.Dockerfile" dockerfile = "dev.Dockerfile"
target = "build-validate" target = "build-validate"
output = ["type=cacheonly"] output = ["type=cacheonly"]
@@ -48,7 +41,6 @@ target "vendor" {
} }
target "vendor-validate" { target "vendor-validate" {
inherits = ["_common"]
dockerfile = "dev.Dockerfile" dockerfile = "dev.Dockerfile"
target = "vendor-validate" target = "vendor-validate"
output = ["type=cacheonly"] output = ["type=cacheonly"]
+2 -15
View File
@@ -1,24 +1,11 @@
import type {Config} from 'jest'; module.exports = {
const config: Config = {
clearMocks: true, clearMocks: true,
moduleFileExtensions: ['js', 'ts'], moduleFileExtensions: ['js', 'ts'],
setupFiles: ['dotenv/config', '<rootDir>/src/test_setup.ts'], setupFiles: ['dotenv/config', '<rootDir>/src/test_setup.ts'],
testMatch: ['**/*.test.ts'], testMatch: ['**/*.test.ts'],
testTimeout: 30000, testTimeout: 30000,
transform: { transform: {
'^.+\\.ts$': [ '^.+\\.ts$': 'ts-jest'
'ts-jest',
{
useESM: true
}
]
},
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1'
}, },
verbose: true verbose: true
}; };
export default config;
-5898
View File
File diff suppressed because it is too large Load Diff
+14 -15
View File
@@ -2,17 +2,16 @@
"name": "goreleaser-action", "name": "goreleaser-action",
"description": "GitHub Action for GoReleaser, a release automation tool for Go projects", "description": "GitHub Action for GoReleaser, a release automation tool for Go projects",
"main": "src/main.ts", "main": "src/main.ts",
"type": "module",
"scripts": { "scripts": {
"build": "ncc build src/main.ts --minify --license licenses.txt", "build": "ncc build src/main.ts --source-map --minify --license licenses.txt",
"lint": "npm run prettier && npm run eslint", "lint": "yarn run prettier && yarn run eslint",
"format": "npm run prettier:fix && npm run eslint:fix", "format": "yarn run prettier:fix && yarn run eslint:fix",
"eslint": "eslint --max-warnings=0 .", "eslint": "eslint --max-warnings=0 .",
"eslint:fix": "eslint --fix .", "eslint:fix": "eslint --fix .",
"prettier": "prettier --check \"./**/*.ts\"", "prettier": "prettier --check \"./**/*.ts\"",
"prettier:fix": "prettier --write \"./**/*.ts\"", "prettier:fix": "prettier --write \"./**/*.ts\"",
"test": "NODE_OPTIONS='--experimental-vm-modules' jest", "test": "jest",
"all": "npm run build && npm run format && npm test" "all": "yarn run build && yarn run format && yarn test"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@@ -25,18 +24,18 @@
], ],
"author": "CrazyMax", "author": "CrazyMax",
"license": "MIT", "license": "MIT",
"packageManager": "yarn@3.6.3",
"dependencies": { "dependencies": {
"@actions/core": "^3.0.0", "@actions/core": "^1.10.1",
"@actions/exec": "^3.0.0", "@actions/exec": "^1.1.1",
"@actions/http-client": "^4.0.0", "@actions/http-client": "^2.2.1",
"@actions/tool-cache": "^4.0.0", "@actions/tool-cache": "^2.0.1",
"js-yaml": "^4.1.1", "js-yaml": "^4.1.0",
"semver": "^7.7.4", "semver": "^7.6.0",
"yargs": "^18.0.0" "yargs": "^17.7.2"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^24.0.0", "@types/node": "^20.6.0",
"@typescript-eslint/eslint-plugin": "^6.6.0", "@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.6.0", "@typescript-eslint/parser": "^6.6.0",
"@vercel/ncc": "^0.38.0", "@vercel/ncc": "^0.38.0",
+1 -1
View File
@@ -15,7 +15,7 @@ export interface Inputs {
export async function getInputs(): Promise<Inputs> { export async function getInputs(): Promise<Inputs> {
return { return {
distribution: core.getInput('distribution') || 'goreleaser', distribution: core.getInput('distribution') || 'goreleaser',
version: core.getInput('version') || '~> v2', version: core.getInput('version') || 'latest',
args: core.getInput('args'), args: core.getInput('args'),
workdir: core.getInput('workdir') || '.', workdir: core.getInput('workdir') || '.',
installOnly: core.getBooleanInput('install-only') installOnly: core.getBooleanInput('install-only')
+32 -69
View File
@@ -3,37 +3,16 @@ import * as semver from 'semver';
import * as core from '@actions/core'; import * as core from '@actions/core';
import * as httpm from '@actions/http-client'; import * as httpm from '@actions/http-client';
const maxRetries = 10;
const timeoutMs = 1000;
const withRetry = async <T>(operation: () => Promise<T>): Promise<T> => {
let lastError: Error;
for (let attempt = 0; attempt <= maxRetries; attempt++) {
try {
return await operation();
} catch (error) {
lastError = error as Error;
if (attempt === maxRetries) {
break;
}
core.debug(`Attempt ${attempt + 1} failed, retrying in ${timeoutMs}: ${lastError.message}`);
await new Promise(resolve => setTimeout(resolve, timeoutMs));
}
}
throw lastError;
};
export interface GitHubRelease { export interface GitHubRelease {
tag_name: string; tag_name: string;
} }
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(
return getReleaseTag(distribution, '~> v2'); "You are using 'latest' as default version. This might include breaking changes. It is recommended to use a SemVer to lock to a major version (e.g. ~> v1)."
);
return getLatestRelease(distribution);
} }
return getReleaseTag(distribution, version); return getReleaseTag(distribution, version);
}; };
@@ -42,43 +21,37 @@ export const getReleaseTag = async (distribution: string, version: string): Prom
if (version === 'nightly') { if (version === 'nightly') {
return {tag_name: version}; return {tag_name: version};
} }
// If version is a specific version (not a range), skip the JSON check
const cleanVersion: string = cleanTag(version);
if (semver.valid(cleanVersion)) {
let tag = version.startsWith('v') ? version : `v${version}`;
// Handle GoReleaser Pro suffix for versions < 2.7.0, but only if not already present
// TODO: remove all this `-pro` thing at some point.
if (goreleaser.isPro(distribution) && semver.lt(cleanVersion, '2.7.0') && !tag.endsWith('-pro')) {
tag = tag + goreleaser.distribSuffix(distribution);
}
return {tag_name: tag};
}
const tag: string = (await resolveVersion(distribution, version)) || version; const tag: string = (await resolveVersion(distribution, version)) || version;
const suffix: string = goreleaser.distribSuffix(distribution); const suffix: string = goreleaser.distribSuffix(distribution);
const url = `https://goreleaser.com/static/releases${suffix}.json`; const url = `https://goreleaser.com/static/releases${suffix}.json`;
const http: httpm.HttpClient = new httpm.HttpClient('goreleaser-action');
const releases = await withRetry(async () => { const resp: httpm.HttpClientResponse = await http.get(url);
const http: httpm.HttpClient = new httpm.HttpClient('goreleaser-action'); const body = await resp.readBody();
const resp: httpm.HttpClientResponse = await http.get(url); const statusCode = resp.message.statusCode || 500;
const body = await resp.readBody(); if (statusCode >= 400) {
const statusCode = resp.message.statusCode || 500; throw new Error(
if (statusCode >= 400) { `Failed to get GoReleaser release ${version}${suffix} from ${url} with status code ${statusCode}: ${body}`
throw new Error( );
`Failed to get GoReleaser release ${version} from ${url} with status code ${statusCode}: ${body}` }
); const releases = <Array<GitHubRelease>>JSON.parse(body);
}
return <Array<GitHubRelease>>JSON.parse(body);
});
const res = releases.filter(r => r.tag_name === tag).shift(); const res = releases.filter(r => r.tag_name === tag).shift();
if (res) { if (res) {
return res; return res;
} }
throw new Error(`Cannot find GoReleaser release ${version} in ${url}`); throw new Error(`Cannot find GoReleaser release ${version}${suffix} in ${url}`);
};
export const getLatestRelease = async (distribution: string): Promise<GitHubRelease> => {
const suffix: string = goreleaser.distribSuffix(distribution);
const url = `https://goreleaser.com/static/latest${suffix}`;
const http: httpm.HttpClient = new httpm.HttpClient('goreleaser-action');
const resp: httpm.HttpClientResponse = await http.get(url);
const body = await resp.readBody();
const statusCode = resp.message.statusCode || 500;
if (statusCode >= 400) {
throw new Error(`Failed to get GoReleaser release latest from ${url} with status code ${statusCode}: ${body}`);
}
return {tag_name: body};
}; };
const resolveVersion = async (distribution: string, version: string): Promise<string | null> => { const resolveVersion = async (distribution: string, version: string): Promise<string | null> => {
@@ -90,16 +63,7 @@ const resolveVersion = async (distribution: string, version: string): Promise<st
const cleanTags: Array<string> = allTags.map(tag => cleanTag(tag)); const cleanTags: Array<string> = allTags.map(tag => cleanTag(tag));
const cleanVersion: string = cleanTag(version); const cleanVersion: string = cleanTag(version);
if (!semver.valid(cleanVersion) && !semver.validRange(cleanVersion)) { return semver.maxSatisfying(cleanTags, cleanVersion) + goreleaser.distribSuffix(distribution);
// if the given version is invalid, return whatever we got.
return version;
}
const v = semver.maxSatisfying(cleanTags, cleanVersion);
if (semver.lt(v, '2.7.0')) {
// if its a version older than 2.7.0, append the suffix.
return v + goreleaser.distribSuffix(distribution);
}
return v;
}; };
interface GitHubTag { interface GitHubTag {
@@ -107,13 +71,12 @@ interface GitHubTag {
} }
const getAllTags = async (distribution: string): Promise<Array<string>> => { const getAllTags = async (distribution: string): Promise<Array<string>> => {
const http: httpm.HttpClient = new httpm.HttpClient('goreleaser-action');
const suffix: string = goreleaser.distribSuffix(distribution); const suffix: string = goreleaser.distribSuffix(distribution);
const url = `https://goreleaser.com/static/releases${suffix}.json`; const url = `https://goreleaser.com/static/releases${suffix}.json`;
core.debug(`Downloading ${url}`); core.debug(`Downloading ${url}`);
const getTags = http.getJson<Array<GitHubTag>>(url);
return withRetry(async () => { return getTags.then(response => {
const http: httpm.HttpClient = new httpm.HttpClient('goreleaser-action');
const response = await http.getJson<Array<GitHubTag>>(url);
if (response.result == null) { if (response.result == null) {
return []; return [];
} }
+2 -12
View File
@@ -1,7 +1,6 @@
import * as fs from 'fs'; import * as fs from 'fs';
import * as path from 'path'; import * as path from 'path';
import yargs from 'yargs'; import yargs from 'yargs';
import type {Arguments} from 'yargs';
import * as context from './context'; import * as context from './context';
import * as goreleaser from './goreleaser'; import * as goreleaser from './goreleaser';
import * as core from '@actions/core'; import * as core from '@actions/core';
@@ -29,20 +28,11 @@ async function run(): Promise<void> {
} }
let yamlfile: string | unknown; let yamlfile: string | unknown;
const argv: Arguments<{config?: string}> = yargs(inputs.args).parseSync() as Arguments<{ const argv: {config: string} = yargs.parse(inputs.args) as never;
config?: string;
}>;
if (argv.config) { if (argv.config) {
yamlfile = argv.config; yamlfile = argv.config;
} else { } else {
[ ['.goreleaser.yaml', '.goreleaser.yml', 'goreleaser.yaml', 'goreleaser.yml'].forEach(f => {
'.config/goreleaser.yaml',
'.config/goreleaser.yml',
'.goreleaser.yaml',
'.goreleaser.yml',
'goreleaser.yaml',
'goreleaser.yml'
].forEach(f => {
if (fs.existsSync(f)) { if (fs.existsSync(f)) {
yamlfile = f; yamlfile = f;
} }
+1 -1
View File
@@ -1,4 +1,4 @@
import * as tmp from 'tmp'; import tmp = require('tmp');
tmp.setGracefulCleanup(); tmp.setGracefulCleanup();
const tmpdir = tmp.dirSync({template: 'goreleaser-XXXXXX'}); const tmpdir = tmp.dirSync({template: 'goreleaser-XXXXXX'});
+6
View File
@@ -17,6 +17,12 @@ builds:
- "386" - "386"
- "amd64" - "amd64"
archives:
-
format_overrides:
- goos: windows
format: zip
checksum: checksum:
name_template: 'checksums.txt' name_template: 'checksums.txt'
+6
View File
@@ -17,5 +17,11 @@ builds:
- "386" - "386"
- "amd64" - "amd64"
archives:
-
format_overrides:
- goos: windows
format: zip
checksum: checksum:
name_template: 'checksums.txt' name_template: 'checksums.txt'
+2 -5
View File
@@ -1,8 +1,8 @@
{ {
"compilerOptions": { "compilerOptions": {
"esModuleInterop": true, "esModuleInterop": true,
"target": "ES2024", "target": "es6",
"module": "ESNext", "module": "commonjs",
"newLine": "lf", "newLine": "lf",
"outDir": "./lib", "outDir": "./lib",
"rootDir": "./src", "rootDir": "./src",
@@ -10,9 +10,6 @@
"noImplicitAny": false, "noImplicitAny": false,
"resolveJsonModule": true, "resolveJsonModule": true,
"useUnknownInCatchVariables": false, "useUnknownInCatchVariables": false,
"moduleResolution": "node",
"strict": false,
"skipLibCheck": true
}, },
"exclude": [ "exclude": [
"node_modules", "node_modules",
+5595
View File
File diff suppressed because it is too large Load Diff