Skip to content

Commit 0396d52

Browse files
committed
chore: rebuild workflows for backport directory
1 parent ca7ca83 commit 0396d52

File tree

7 files changed

+283
-5
lines changed

7 files changed

+283
-5
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This file is automatically added by @npmcli/template-oss. Do not edit.
2+
3+
name: 'Create Check'
4+
inputs:
5+
name:
6+
required: true
7+
token:
8+
required: true
9+
sha:
10+
required: true
11+
check-name:
12+
default: ''
13+
outputs:
14+
check-id:
15+
value: ${{ steps.create-check.outputs.check_id }}
16+
runs:
17+
using: "composite"
18+
steps:
19+
- name: Get Workflow Job
20+
uses: actions/github-script@v7
21+
id: workflow
22+
env:
23+
JOB_NAME: "${{ inputs.name }}"
24+
SHA: "${{ inputs.sha }}"
25+
with:
26+
result-encoding: string
27+
script: |
28+
const { repo: { owner, repo}, runId, serverUrl } = context
29+
const { JOB_NAME, SHA } = process.env
30+
31+
const job = await github.rest.actions.listJobsForWorkflowRun({
32+
owner,
33+
repo,
34+
run_id: runId,
35+
per_page: 100
36+
}).then(r => r.data.jobs.find(j => j.name.endsWith(JOB_NAME)))
37+
38+
return [
39+
`This check is assosciated with ${serverUrl}/${owner}/${repo}/commit/${SHA}.`,
40+
'Run logs:',
41+
job?.html_url || `could not be found for a job ending with: "${JOB_NAME}"`,
42+
].join(' ')
43+
- name: Create Check
44+
uses: LouisBrunner/checks-action@v1.6.0
45+
id: create-check
46+
with:
47+
token: ${{ inputs.token }}
48+
sha: ${{ inputs.sha }}
49+
status: in_progress
50+
name: ${{ inputs.check-name || inputs.name }}
51+
output: |
52+
{"summary":"${{ steps.workflow.outputs.result }}"}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# This file is automatically added by @npmcli/template-oss. Do not edit.
2+
3+
name: 'Install Latest npm'
4+
description: 'Install the latest version of npm compatible with the Node version'
5+
inputs:
6+
node:
7+
description: 'Current Node version'
8+
required: true
9+
runs:
10+
using: "composite"
11+
steps:
12+
# node 10/12/14 ship with npm@6, which is known to fail when updating itself in windows
13+
- name: Update Windows npm
14+
if: |
15+
runner.os == 'Windows' && (
16+
startsWith(inputs.node, 'v10.') ||
17+
startsWith(inputs.node, 'v12.') ||
18+
startsWith(inputs.node, 'v14.')
19+
)
20+
shell: cmd
21+
run: |
22+
curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
23+
tar xf npm-7.5.4.tgz
24+
cd package
25+
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
26+
cd ..
27+
rmdir /s /q package
28+
- name: Install Latest npm
29+
shell: bash
30+
env:
31+
NODE_VERSION: ${{ inputs.node }}
32+
working-directory: ${{ runner.temp }}
33+
run: |
34+
MATCH=""
35+
SPECS=("latest" "next-10" "next-9" "next-8" "next-7" "next-6")
36+
37+
echo "node@$NODE_VERSION"
38+
39+
for SPEC in ${SPECS[@]}; do
40+
ENGINES=$(npm view npm@$SPEC --json | jq -r '.engines.node')
41+
echo "Checking if node@$NODE_VERSION satisfies npm@$SPEC ($ENGINES)"
42+
43+
if npx semver -r "$ENGINES" "$NODE_VERSION" > /dev/null; then
44+
MATCH=$SPEC
45+
echo "Found compatible version: npm@$MATCH"
46+
break
47+
fi
48+
done
49+
50+
if [ -z $MATCH ]; then
51+
echo "Could not find a compatible version of npm for node@$NODE_VERSION"
52+
exit 1
53+
fi
54+
55+
npm i --prefer-online --no-fund --no-audit -g npm@$MATCH
56+
- name: npm Version
57+
shell: bash
58+
run: npm -v

.github/settings.yml

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,55 @@
1-
---
2-
_extends: '.github:npm-cli/settings.yml'
1+
# This file is automatically added by @npmcli/template-oss. Do not edit.
2+
3+
repository:
4+
allow_merge_commit: false
5+
allow_rebase_merge: true
6+
allow_squash_merge: true
7+
squash_merge_commit_title: PR_TITLE
8+
squash_merge_commit_message: PR_BODY
9+
delete_branch_on_merge: true
10+
enable_automated_security_fixes: true
11+
enable_vulnerability_alerts: true
12+
13+
branches:
14+
- name: main
15+
protection:
16+
required_status_checks: null
17+
enforce_admins: true
18+
block_creations: true
19+
required_pull_request_reviews:
20+
required_approving_review_count: 1
21+
require_code_owner_reviews: true
22+
require_last_push_approval: true
23+
dismiss_stale_reviews: true
24+
restrictions:
25+
apps: []
26+
users: []
27+
teams: [ "cli-team" ]
28+
- name: release/v5
29+
protection:
30+
required_status_checks: null
31+
enforce_admins: true
32+
block_creations: true
33+
required_pull_request_reviews:
34+
required_approving_review_count: 1
35+
require_code_owner_reviews: true
36+
require_last_push_approval: true
37+
dismiss_stale_reviews: true
38+
restrictions:
39+
apps: []
40+
users: []
41+
teams: [ "cli-team" ]
42+
- name: release/v6
43+
protection:
44+
required_status_checks: null
45+
enforce_admins: true
46+
block_creations: true
47+
required_pull_request_reviews:
48+
required_approving_review_count: 1
49+
require_code_owner_reviews: true
50+
require_last_push_approval: true
51+
dismiss_stale_reviews: true
52+
restrictions:
53+
apps: []
54+
users: []
55+
teams: [ "cli-team" ]
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# This file is automatically added by @npmcli/template-oss. Do not edit.
2+
3+
name: Release Integration
4+
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
releases:
9+
required: true
10+
type: string
11+
description: 'A json array of releases. Required fields: publish: tagName, publishTag. publish check: pkgName, version'
12+
workflow_call:
13+
inputs:
14+
releases:
15+
required: true
16+
type: string
17+
description: 'A json array of releases. Required fields: publish: tagName, publishTag. publish check: pkgName, version'
18+
19+
jobs:
20+
publish:
21+
name: Check Publish
22+
runs-on: ubuntu-latest
23+
defaults:
24+
run:
25+
shell: bash
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
- name: Setup Git User
30+
run: |
31+
git config --global user.email "npm-cli+bot@github.com"
32+
git config --global user.name "npm CLI robot"
33+
- name: Setup Node
34+
uses: actions/setup-node@v4
35+
id: node
36+
with:
37+
node-version: 22.x
38+
check-latest: contains('22.x', '.x')
39+
- name: Install Latest npm
40+
uses: ./.github/actions/install-latest-npm
41+
with:
42+
node: ${{ steps.node.outputs.node-version }}
43+
- name: Install Dependencies
44+
run: npm i --ignore-scripts --no-audit --no-fund
45+
- name: Check If Published
46+
env:
47+
RELEASES: ${{ inputs.releases }}
48+
run: |
49+
EXIT_CODE=0
50+
51+
for release in $(echo $RELEASES | jq -r '.[] | @base64'); do
52+
SPEC="$(echo "$release" | base64 --decode | jq -r .pkgName)@$(echo "$release" | base64 --decode | jq -r .version)"
53+
npm view "$SPEC" --json
54+
STATUS=$?
55+
if [[ "$STATUS" -eq 1 ]]; then
56+
EXIT_CODE=$STATUS
57+
echo "$SPEC ERROR"
58+
else
59+
echo "$SPEC OK"
60+
fi
61+
done
62+
63+
exit $EXIT_CODE

CONTRIBUTING.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<!-- This file is automatically added by @npmcli/template-oss. Do not edit. -->
2+
3+
# Contributing
4+
5+
## Code of Conduct
6+
7+
All interactions in the **npm** organization on GitHub are considered to be covered by our standard [Code of Conduct](https://docs.npmjs.com/policies/conduct).
8+
9+
## Reporting Bugs
10+
11+
Before submitting a new bug report please search for an existing or similar report.
12+
13+
Use one of our existing issue templates if you believe you've come across a unique problem.
14+
15+
Duplicate issues, or issues that don't use one of our templates may get closed without a response.
16+
17+
## Pull Request Conventions
18+
19+
### Commits
20+
21+
We use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
22+
23+
When opening a pull request please be sure that either the pull request title, or each commit in the pull request, has one of the following prefixes:
24+
25+
- `feat`: For when introducing a new feature. The result will be a new semver minor version of the package when it is next published.
26+
- `fix`: For bug fixes. The result will be a new semver patch version of the package when it is next published.
27+
- `docs`: For documentation updates. The result will be a new semver patch version of the package when it is next published.
28+
- `chore`: For changes that do not affect the published module. Often these are changes to tests. The result will be *no* change to the version of the package when it is next published (as the commit does not affect the published version).
29+
30+
### Test Coverage
31+
32+
Pull requests made against this repo will run `npm test` automatically. Please make sure tests pass locally before submitting a PR.
33+
34+
Every new feature or bug fix should come with a corresponding test or tests that validate the solutions. Testing also reports on code coverage and will fail if code coverage drops.
35+
36+
### Linting
37+
38+
Linting is also done automatically once tests pass. `npm run lintfix` will fix most linting errors automatically.
39+
40+
Please make sure linting passes before submitting a PR.
41+
42+
## What _not_ to contribute?
43+
44+
### Dependencies
45+
46+
It should be noted that our team does not accept third-party dependency updates/PRs. If you submit a PR trying to update our dependencies we will close it with or without a reference to these contribution guidelines.
47+
48+
### Tools/Automation
49+
50+
Our core team is responsible for the maintenance of the tooling/automation in this project and we ask contributors to not make changes to these when contributing (e.g. `.github/*`, `.eslintrc.json`, `.licensee.json`). Most of those files also have a header at the top to remind folks they are automatically generated. Pull requests that alter these will not be accepted.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"lint": "eslint \"**/*.js\"",
2828
"postlint": "template-oss-check",
2929
"lintfix": "npm run lint -- --fix",
30-
"template-oss-apply": "template-oss-apply --force"
30+
"template-oss-apply": "template-oss-apply --force",
31+
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
3132
},
3233
"dependencies": {
3334
"lru-cache": "^7.5.1"

release-please-config.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"exclude-packages-from-root": true,
32
"group-pull-request-title-pattern": "chore: release ${version}",
43
"pull-request-title-pattern": "chore: release${component} ${version}",
54
"changelog-sections": [
@@ -32,5 +31,7 @@
3231
".": {
3332
"package-name": ""
3433
}
35-
}
34+
},
35+
"prerelease-type": "pre",
36+
"exclude-packages-from-root": true
3637
}

0 commit comments

Comments
 (0)