mirror of
https://github.com/goreleaser/goreleaser-action.git
synced 2026-05-15 07:10:31 +00:00
Match the standard layout used by actions/checkout, actions/setup-node, etc.: - package.json scripts: split format/format-check (Prettier) from lint/lint:fix (ESLint), and have pre-checkin run all four (format, lint:fix, build, test) in that order. - validate.yml lint job runs format-check + lint as separate steps. - test.yml drops the redundant --coverage flag (now in the test script). - Drop dependabot-build.yml: actions/* don't auto-rebuild dist on dependabot PRs; the check-dist style validate / build job catches drift and a maintainer rebuilds locally if needed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
98 lines
2.6 KiB
YAML
98 lines
2.6 KiB
YAML
name: validate
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
|
|
permissions:
|
|
contents: read
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
- 'releases/v*'
|
|
pull_request:
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
-
|
|
name: Setup Node.js
|
|
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v6.0.0
|
|
with:
|
|
node-version-file: '.node-version'
|
|
cache: npm
|
|
-
|
|
name: Install dependencies
|
|
run: npm ci
|
|
-
|
|
name: Format check
|
|
run: npm run format-check
|
|
-
|
|
name: Lint
|
|
run: npm run lint
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
-
|
|
name: Setup Node.js
|
|
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v6.0.0
|
|
with:
|
|
node-version-file: '.node-version'
|
|
cache: npm
|
|
-
|
|
name: Install dependencies
|
|
run: npm ci --ignore-scripts
|
|
-
|
|
name: Rebuild dist
|
|
run: npm run build
|
|
-
|
|
name: Compare dist
|
|
id: diff
|
|
run: |
|
|
if [ "$(git diff --ignore-space-at-eol dist | wc -l)" -gt "0" ]; then
|
|
echo "Detected uncommitted changes after build. Run 'npm run build' and commit dist/." >&2
|
|
git diff dist
|
|
exit 1
|
|
fi
|
|
-
|
|
name: Upload built dist on failure
|
|
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
|
|
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
|
with:
|
|
name: dist
|
|
path: dist
|
|
|
|
vendor:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
-
|
|
name: Setup Node.js
|
|
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v6.0.0
|
|
with:
|
|
node-version-file: '.node-version'
|
|
cache: npm
|
|
-
|
|
name: Refresh package-lock.json
|
|
run: npm install --package-lock-only
|
|
-
|
|
name: Compare package-lock.json
|
|
run: |
|
|
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
|
|
git diff package-lock.json
|
|
exit 1
|
|
fi
|