@seangalie/precast 0.3.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/dist/collect.d.ts +1 -1
- package/dist/collect.js +6 -1
- package/package.json +1 -1
- package/platforms/forgejo/files/.forgejo/SETUP.md.tmpl +14 -10
- package/platforms/forgejo/files/.forgejo/workflows/lint.yml.tmpl +8 -5
- package/platforms/forgejo/files/.forgejo/workflows/pre-commit.yml.tmpl +10 -1
- package/platforms/forgejo/platform.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,32 @@ and [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.4.1] - 2026-11-29
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Generated helper scripts, such as `.repo/ci-checks.sh` and
|
|
13
|
+
`.repo/check-secrets.py`, are executable. On filesystems with POSIX
|
|
14
|
+
permissions, every file that starts with `#!` is written as 755 and every
|
|
15
|
+
other file as 644, instead of copying the source file's mode, which was 644 in
|
|
16
|
+
the package. Native Windows keeps its own permissions.
|
|
17
|
+
|
|
18
|
+
## [0.4.0] - 2026-11-29
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- Generated Forgejo workflows run on the `node-latest` runner label instead of
|
|
23
|
+
`ubuntu-latest`. Forgejo's checkout action needs Node.js in the job container,
|
|
24
|
+
and runners that map `ubuntu-latest` to the stock Ubuntu image fail before
|
|
25
|
+
the first step. Generate with `--runner LABEL` to keep another label.
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- The generated Forgejo Pre-commit job installs Python's venv with apt when the
|
|
30
|
+
job container lacks it, as official Node.js and Debian images do.
|
|
31
|
+
- Generated Forgejo projects' actionlint checks no longer reject runner labels
|
|
32
|
+
that actionlint doesn't know, such as `node-latest` or a `--runner` label.
|
|
33
|
+
|
|
8
34
|
## [0.3.0] - 2026-11-18
|
|
9
35
|
|
|
10
36
|
### Added
|
package/dist/collect.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type Context } from "./context.ts";
|
|
|
2
2
|
import { type Tier } from "./tiers.ts";
|
|
3
3
|
export interface OutputFile {
|
|
4
4
|
data: Buffer;
|
|
5
|
-
/**
|
|
5
|
+
/** 755 for a script, which starts with `#!`, and 644 for everything else. */
|
|
6
6
|
mode: number;
|
|
7
7
|
}
|
|
8
8
|
/** Output files keyed by POSIX relative path, in source order. */
|
package/dist/collect.js
CHANGED
|
@@ -68,7 +68,9 @@ export function collectFiles(root, platformName, context, tier = "full") {
|
|
|
68
68
|
if (rendered) {
|
|
69
69
|
data = Buffer.from(render(data, tier, context, source), "utf8");
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
// The source's own mode is not used: npm packs and Git checkouts on
|
|
72
|
+
// Windows drop executable bits, so the shebang decides.
|
|
73
|
+
files.set(output, { data, mode: isScript(data) ? 0o755 : 0o644 });
|
|
72
74
|
}
|
|
73
75
|
// A stale entry would silently stop placing a renamed file in its tier.
|
|
74
76
|
if (unmatched.size > 0) {
|
|
@@ -135,6 +137,9 @@ export function comparePaths(left, right) {
|
|
|
135
137
|
}
|
|
136
138
|
return a.length - b.length;
|
|
137
139
|
}
|
|
140
|
+
function isScript(data) {
|
|
141
|
+
return data[0] === 0x23 && data[1] === 0x21;
|
|
142
|
+
}
|
|
138
143
|
/** The final extension, ignoring a leading dot, as in `name.tmpl` but not `.tmpl`. */
|
|
139
144
|
function suffix(path) {
|
|
140
145
|
const name = basename(path);
|
package/package.json
CHANGED
|
@@ -11,20 +11,24 @@ Generate with `--tier regular` or `--tier full` for issue templates, CI, and aut
|
|
|
11
11
|
@@TIERS regular@@
|
|
12
12
|
- [ ] Enable the repository units I need under Settings, including Issues and
|
|
13
13
|
Actions. Confirm a runner advertises the selected label from the workflow files.
|
|
14
|
-
The
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
The default `node-latest` label expects an official Node.js image, such as
|
|
15
|
+
`node:26-trixie`, because the checkout action needs Node.js. The Pre-commit job
|
|
16
|
+
runs in that label's job container, so its image must provide Git and Bash, and
|
|
17
|
+
either Python 3.10+ with venv or apt to install it, plus access to the Python
|
|
18
|
+
package index, GitHub hook sources, and Go toolchain/module downloads. Hosted
|
|
19
|
+
runners, such as Codeberg's, may use their own labels instead of `node-latest`;
|
|
20
|
+
generate with `--runner LABEL` to match one.
|
|
19
21
|
@@END_TIERS@@
|
|
20
22
|
@@TIERS full@@
|
|
21
23
|
- [ ] Enable the repository units I need under Settings, including Issues, Actions,
|
|
22
24
|
and Releases. Confirm a runner advertises the selected label from the workflow files.
|
|
23
|
-
The
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
The default `node-latest` label expects an official Node.js image, such as
|
|
26
|
+
`node:26-trixie`, because the checkout action needs Node.js. The Pre-commit job
|
|
27
|
+
runs in that label's job container, so its image must provide Git and Bash, and
|
|
28
|
+
either Python 3.10+ with venv or apt to install it, plus access to the Python
|
|
29
|
+
package index, GitHub hook sources, and Go toolchain/module downloads. Hosted
|
|
30
|
+
runners, such as Codeberg's, may use their own labels instead of `node-latest`;
|
|
31
|
+
generate with `--runner LABEL` to match one.
|
|
28
32
|
- [ ] Run **Actions → Sync labels → Run workflow** once after the first push. It
|
|
29
33
|
uses `.forgejo/labels.yml`; PR Labels needs these labels to exist. Alternatively,
|
|
30
34
|
run `.forgejo/scripts/sync-labels.sh` with `FORGEJO_API`, `FORGEJO_TOKEN`, `OWNER`,
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
@@END_TIERS@@
|
|
15
15
|
#
|
|
16
16
|
# Tests that need another image belong in a `docker://` step like these, not
|
|
17
|
-
# on a different runner label: plain images such as debian-*
|
|
18
|
-
# the JavaScript checkout action fails before the first step. A `container:`
|
|
17
|
+
# on a different runner label: plain images such as debian-* or ubuntu-* have
|
|
18
|
+
# no node, so the JavaScript checkout action fails before the first step. A `container:`
|
|
19
19
|
# does not help either, since the steps then run inside it.
|
|
20
20
|
|
|
21
21
|
name: Lint
|
|
@@ -39,9 +39,11 @@ jobs:
|
|
|
39
39
|
|
|
40
40
|
# actionlint also runs shellcheck over every `run:` block; the image
|
|
41
41
|
# bundles it. It only discovers .github/workflows by itself, hence the
|
|
42
|
-
# explicit file discovery below. The -ignore covers the
|
|
42
|
+
# explicit file discovery below. The first -ignore covers the
|
|
43
43
|
# full-URL `uses:` that Forgejo needs to reach actions on another host,
|
|
44
|
-
# which actionlint does not know about.
|
|
44
|
+
# which actionlint does not know about. The second covers runner labels:
|
|
45
|
+
# actionlint knows only GitHub's hosted ones, and Forgejo labels are
|
|
46
|
+
# whatever the instance's runners advertise.
|
|
45
47
|
- name: 🎬 actionlint
|
|
46
48
|
uses: docker://rhysd/actionlint:1.7.12@sha256:b1934ee5f1c509618f2508e6eb47ee0d3520686341fec936f3b79331f9315667
|
|
47
49
|
with:
|
|
@@ -50,7 +52,8 @@ jobs:
|
|
|
50
52
|
-c 'find .forgejo/workflows -maxdepth 1 -type f
|
|
51
53
|
\( -name "*.yml" -o -name "*.yaml" \)
|
|
52
54
|
-exec actionlint -color
|
|
53
|
-
-ignore "specifying action \"https://[^\"]+\" in invalid format"
|
|
55
|
+
-ignore "specifying action \"https://[^\"]+\" in invalid format"
|
|
56
|
+
-ignore "label \"[^\"]+\" is unknown" {} +'
|
|
54
57
|
|
|
55
58
|
# actionlint only reaches shell inside workflows, so standalone scripts
|
|
56
59
|
# get their own pass. Any *.sh or *.bash outside .git is picked up; a
|
|
@@ -15,8 +15,17 @@ jobs:
|
|
|
15
15
|
uses: https://data.forgejo.org/actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
16
16
|
with:
|
|
17
17
|
persist-credentials: false
|
|
18
|
+
# Official Node.js and Debian images ship Python without venv support,
|
|
19
|
+
# or no Python at all. Install it only when it is missing, so an image
|
|
20
|
+
# that already has it skips the download.
|
|
21
|
+
- name: Make sure Python's venv is available
|
|
22
|
+
run: |
|
|
23
|
+
set -euo pipefail
|
|
24
|
+
python3 -c 'import ensurepip, venv' >/dev/null 2>&1 || {
|
|
25
|
+
apt-get update -qq && apt-get install -y -qq --no-install-recommends python3-venv
|
|
26
|
+
}
|
|
18
27
|
# Runs in the job container, whose image must provide Git, Bash, and
|
|
19
|
-
# Python 3.10+ with venv. See .forgejo/SETUP.md.
|
|
28
|
+
# either apt or Python 3.10+ with venv. See .forgejo/SETUP.md.
|
|
20
29
|
- name: Run pre-commit checks
|
|
21
30
|
env:
|
|
22
31
|
# The digest-pinned Lint job owns these checks in CI. Local hooks run all.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"server_url": "https://codeberg.org",
|
|
3
3
|
"nested_namespaces": false,
|
|
4
|
-
"runner": "
|
|
4
|
+
"runner": "node-latest",
|
|
5
5
|
"codeowners_pattern": ".*",
|
|
6
6
|
"tiers": {
|
|
7
7
|
"regular": [
|
|
@@ -37,6 +37,6 @@
|
|
|
37
37
|
"SECURITY_CHANNEL": "Set a private reporting address below before publishing this project.",
|
|
38
38
|
"LABEL_NOTE": "Run Sync labels once from Actions after the first push. PR Labels requires these labels.",
|
|
39
39
|
"EXTRA_SETUP": "Review Renovate and its bot credentials in `.forgejo/SETUP.md`. Confirm a runner with the chosen label exists before requiring checks.",
|
|
40
|
-
"PRE_COMMIT_WORKFLOW_HOOKS": "\n - repo: https://github.com/rhysd/actionlint\n rev: 914e7df21a07ef503a81201c76d2b11c789d3fca # frozen: v1.7.12\n hooks:\n - id: actionlint\n files: ^\\.forgejo/workflows/.*\\.ya?ml$\n args:\n - -ignore\n - 'specifying action \"https://[^\"]+\" in invalid format'"
|
|
40
|
+
"PRE_COMMIT_WORKFLOW_HOOKS": "\n - repo: https://github.com/rhysd/actionlint\n rev: 914e7df21a07ef503a81201c76d2b11c789d3fca # frozen: v1.7.12\n hooks:\n - id: actionlint\n files: ^\\.forgejo/workflows/.*\\.ya?ml$\n args:\n - -ignore\n - 'specifying action \"https://[^\"]+\" in invalid format'\n - -ignore\n - 'label \"[^\"]+\" is unknown'"
|
|
41
41
|
}
|
|
42
42
|
}
|