mirror of
https://github.com/goreleaser/goreleaser-action.git
synced 2026-05-20 09:21:53 +00:00
build: align scripts and workflows with actions/* convention
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>
This commit is contained in:
parent
8629535418
commit
9ad67fd92a
5 changed files with 16 additions and 63 deletions
49
.github/workflows/dependabot-build.yml
vendored
49
.github/workflows/dependabot-build.yml
vendored
|
|
@ -1,49 +0,0 @@
|
|||
name: dependabot-build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'package.json'
|
||||
- 'package-lock.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: 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: Build
|
||||
run: npm run build
|
||||
-
|
||||
name: Format
|
||||
run: npm run format
|
||||
-
|
||||
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"
|
||||
git push
|
||||
fi
|
||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
|
@ -38,7 +38,7 @@ jobs:
|
|||
run: npm ci
|
||||
-
|
||||
name: Test
|
||||
run: npm test -- --coverage
|
||||
run: npm test
|
||||
-
|
||||
name: Upload coverage
|
||||
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
|
||||
|
|
|
|||
3
.github/workflows/validate.yml
vendored
3
.github/workflows/validate.yml
vendored
|
|
@ -31,6 +31,9 @@ jobs:
|
|||
-
|
||||
name: Install dependencies
|
||||
run: npm ci
|
||||
-
|
||||
name: Format check
|
||||
run: npm run format-check
|
||||
-
|
||||
name: Lint
|
||||
run: npm run lint
|
||||
|
|
|
|||
|
|
@ -40,10 +40,12 @@ or rerun `npm run build` locally with the Node version in `.node-version`.
|
|||
| Script | Purpose |
|
||||
| ------------------- | ------------------------------------------------ |
|
||||
| `npm run build` | Bundle `src/` to `dist/index.js` via `ncc` |
|
||||
| `npm run lint` | Prettier check + ESLint |
|
||||
| `npm run format` | Prettier write + ESLint --fix |
|
||||
| `npm test` | Run Jest |
|
||||
| `npm run pre-checkin` | `format` + `build` + `test` |
|
||||
| `npm run format` | Run Prettier (write) |
|
||||
| `npm run format-check` | Run Prettier (check only, used in CI) |
|
||||
| `npm run lint` | Run ESLint (check only, used in CI) |
|
||||
| `npm run lint:fix` | Run ESLint with `--fix` |
|
||||
| `npm test` | Run Jest with coverage |
|
||||
| `npm run pre-checkin` | `format` + `lint:fix` + `build` + `test` |
|
||||
|
||||
## Tests
|
||||
|
||||
|
|
|
|||
15
package.json
15
package.json
|
|
@ -5,15 +5,12 @@
|
|||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "ncc build src/main.ts --minify --license licenses.txt",
|
||||
"lint": "npm run prettier && npm run eslint",
|
||||
"format": "npm run prettier:fix && npm run eslint:fix",
|
||||
"eslint": "eslint --max-warnings=0 .",
|
||||
"eslint:fix": "eslint --fix .",
|
||||
"prettier": "prettier --check \"./**/*.ts\"",
|
||||
"prettier:fix": "prettier --write \"./**/*.ts\"",
|
||||
"test": "NODE_OPTIONS='--experimental-vm-modules' jest",
|
||||
"pre-checkin": "npm run format && npm run build && npm test",
|
||||
"all": "npm run build && npm run format && npm test"
|
||||
"format": "prettier --write \"**/*.ts\"",
|
||||
"format-check": "prettier --check \"**/*.ts\"",
|
||||
"lint": "eslint --max-warnings=0 \"**/*.ts\"",
|
||||
"lint:fix": "eslint --fix \"**/*.ts\"",
|
||||
"test": "NODE_OPTIONS='--experimental-vm-modules' jest --coverage",
|
||||
"pre-checkin": "npm run format && npm run lint:fix && npm run build && npm test"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue