Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/chant-ci-green.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
GIT_COMMITTER_NAME: github-actions[bot]
GIT_COMMITTER_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
run: npx --yes @intentius/chant@0.124.91 ci tick
run: npx --yes @intentius/chant@0.124.103 ci tick
25 changes: 21 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ on:
workflow_dispatch:
inputs:
label:
description: The release's label, such as v1.4.0
description: The release's label, such as v1.4.0, or auto for the one chant release next computes
required: true
type: string
permissions:
contents: write
id-token: write
packages: write
contents: read
concurrency:
group: chant-release
cancel-in-progress: false
Expand All @@ -19,8 +17,11 @@ env:
jobs:
gate:
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
commit: ${{ steps.green.outputs.commit }}
label: ${{ steps.green.outputs.label }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
Expand All @@ -40,12 +41,18 @@ jobs:
echo "the newest green commit, $commit, has other workflow files than $GITHUB_SHA, and GitHub refuses this job's token a tag on it, so no release is cut. Dispatch again once ${changed:-$GITHUB_SHA}, which changed .github/workflows, or a commit after it is green." >&2
exit 1
fi
label="$CHANT_RELEASE_LABEL"; if [ "$label" = auto ]; then rc=0; git ls-remote --exit-code --heads origin chant/lifecycle >/dev/null || rc=$?; if [ "$rc" = 0 ]; then git fetch origin chant/lifecycle:chant/lifecycle; elif [ "$rc" != 2 ]; then exit "$rc"; fi; next="$(npx chant release next --at "$commit" --json)" || { echo "release next found no label for $commit, so no release is cut: $next" >&2; exit 1; }; label="$(printf '%s' "$next" | node -e 'const f=process.argv[1];const t=f?require("fs").readFileSync(f,"utf8"):require("fs").readFileSync(0,"utf8");const d=JSON.parse(t);process.stdout.write(String(d.label??""))')"; fi
echo "commit=$commit" >> "$GITHUB_OUTPUT"
echo "label=$label" >> "$GITHUB_OUTPUT"
cut:
needs: gate
runs-on: ubuntu-latest
permissions:
contents: write
env:
CHANT_RELEASE_COMMIT: ${{ needs.gate.outputs.commit }}
CHANT_RELEASE_LABEL: ${{ needs.gate.outputs.label }}
GITHUB_TOKEN: ${{ github.token }}
OCI_USERNAME: "${{ github.actor }}"
OCI_PASSWORD: "${{ github.token }}"
steps:
Expand All @@ -62,6 +69,7 @@ jobs:
with:
platforms: "arm64"
- run: "have=\"$(npm --version)\"; if [ \"$(printf '%s\\n' \"11.5.1\" \"$have\" | sort -V | head -n1)\" != \"11.5.1\" ]; then npm install -g npm@11.19.0; fi; npm --version"
- run: npx chant release doctor
- run: git fetch origin 'refs/tags/ci/*:refs/tags/ci/*'
- run: rc=0; git ls-remote --exit-code --heads origin chant/lifecycle >/dev/null || rc=$?; if [ "$rc" = 0 ]; then git fetch origin chant/lifecycle:chant/lifecycle; elif [ "$rc" != 2 ]; then exit "$rc"; fi
- run: |
Expand All @@ -80,7 +88,12 @@ jobs:
publish:
needs: [gate, cut]
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
packages: write
env:
CHANT_RELEASE_LABEL: ${{ needs.gate.outputs.label }}
GITHUB_TOKEN: ${{ github.token }}
OCI_USERNAME: "${{ github.actor }}"
OCI_PASSWORD: "${{ github.token }}"
Expand Down Expand Up @@ -111,6 +124,10 @@ jobs:
after-release:
needs: [gate, publish]
runs-on: ubuntu-latest
permissions:
contents: read
env:
CHANT_RELEASE_LABEL: ${{ needs.gate.outputs.label }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type: reference
`@intentius/sql-yodeler` is on npm. It needs Node 22.12 or later, and the project also needs chant and the `sql` lexicon, which `chant.config.ts` and the declarations import:

```sh
npm install @intentius/sql-yodeler @intentius/chant@0.124.91 @intentius/chant-lexicon-sql@0.124.91
npm install @intentius/sql-yodeler @intentius/chant@0.124.103 @intentius/chant-lexicon-sql@0.124.102
npx yodel --version
```

Expand Down
2 changes: 1 addition & 1 deletion docs/workspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This needs chant 0.124.23 or later (INTENTIUS/chant#3931, #3932 and #3941).
{
"name": "shop",
"schema": 1,
"pins": [{ "package": "@intentius/chant-lexicon-sql", "version": "0.124.91" }],
"pins": [{ "package": "@intentius/chant-lexicon-sql", "version": "0.124.102" }],
"members": [
{ "name": "db", "dir": "db", "kind": "chant" },
{
Expand Down
4 changes: 2 additions & 2 deletions examples/clickhouse/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"build": "chant build src --lexicon sql -o dist/schema.json"
},
"dependencies": {
"@intentius/chant": "0.124.91",
"@intentius/chant-lexicon-sql": "0.124.91",
"@intentius/chant": "0.124.103",
"@intentius/chant-lexicon-sql": "0.124.102",
"@intentius/sql-yodeler": "file:../.."
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions examples/computed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"build": "chant build src --lexicon sql -o dist/schema.json"
},
"dependencies": {
"@intentius/chant": "0.124.91",
"@intentius/chant-lexicon-sql": "0.124.91",
"@intentius/chant": "0.124.103",
"@intentius/chant-lexicon-sql": "0.124.102",
"@intentius/sql-yodeler": "file:../.."
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions examples/postgres/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"build": "chant build src --lexicon sql -o dist/schema.json"
},
"dependencies": {
"@intentius/chant": "0.124.91",
"@intentius/chant-lexicon-sql": "0.124.91",
"@intentius/chant": "0.124.103",
"@intentius/chant-lexicon-sql": "0.124.102",
"@intentius/sql-yodeler": "file:../.."
},
"devDependencies": {
Expand Down
82 changes: 44 additions & 38 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@
"grant": "tsx scripts/grant.ts"
},
"dependencies": {
"@intentius/chant": "^0.124.91",
"@intentius/chant-lexicon-forgejo": "^0.124.91",
"@intentius/chant-lexicon-github": "^0.124.91",
"@intentius/chant-lexicon-gitlab": "^0.124.91",
"@intentius/chant-lexicon-sql": "^0.124.91",
"@intentius/chant": "^0.124.103",
"@intentius/chant-lexicon-forgejo": "^0.124.101",
"@intentius/chant-lexicon-github": "^0.124.101",
"@intentius/chant-lexicon-gitlab": "^0.124.101",
"@intentius/chant-lexicon-sql": "^0.124.102",
"tsx": "^4.23.15"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@intentius/chant-lexicon-docker": "^0.124.91",
"@intentius/chant-lexicon-docker": "^0.124.101",
"@types/node": "^22.20.5",
"@types/pg": "^8.23.1",
"ajv": "^8.20.0",
Expand Down
10 changes: 5 additions & 5 deletions templates/clickhouse/.forgejo/workflows/yodel-new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
env:
CHANT_CHECKOUT_TOKEN: '${{ github.token }}'
PR_NUMBER: '${{ github.event.issue.number }}'
run: |
run: |-
set -eu
git config --global --add safe.directory "$PWD" 2>/dev/null || true
[ -d .git ] || git init -q .
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
PROD_CLICKHOUSE_URL: '${{ secrets.PROD_CLICKHOUSE_URL }}'
PROD_CLICKHOUSE_READER_USER: '${{ secrets.PROD_CLICKHOUSE_READER_USER }}'
PROD_CLICKHOUSE_READER_PASSWORD: '${{ secrets.PROD_CLICKHOUSE_READER_PASSWORD }}'
run: |
run: |-
if [ -z "${CHANT_NO_FORGE_TOKEN:-}" ] && [ "${0#*/}" != "$0" ] && [ -f "$0" ] && ! { [ "${0##*/}" = sh ] || [ "${0##*/}" = bash ] || [ "${0##*/}" = dash ]; } && command -v env >/dev/null 2>&1 && command -v sh >/dev/null 2>&1; then exec env -u CHANT_FORGE_TOKEN -u CHANT_GITHUB_TOKEN -u CHANT_FORGEJO_TOKEN -u CHANT_GITLAB_TOKEN -u CHANT_CHECKOUT_TOKEN -u GITHUB_TOKEN -u GH_TOKEN -u FORGEJO_TOKEN -u GITEA_TOKEN -u GITLAB_TOKEN -u CI_JOB_TOKEN -u ACTIONS_RUNTIME_TOKEN CHANT_NO_FORGE_TOKEN=1 sh -e "$0"; fi; unset CHANT_FORGE_TOKEN CHANT_GITHUB_TOKEN CHANT_FORGEJO_TOKEN CHANT_GITLAB_TOKEN CHANT_CHECKOUT_TOKEN GITHUB_TOKEN GH_TOKEN FORGEJO_TOKEN GITEA_TOKEN GITLAB_TOKEN CI_JOB_TOKEN ACTIONS_RUNTIME_TOKEN
chant_report="$PWD/.chant/commit"
chant_handover() { node -e 'const fs=require("fs"),p=require("path"),z=require("zlib");const [dir,out]=process.argv.slice(1);const CHUNK=1000000,PARTS=4,NOTE=["decision.json","rc","output","change.patch"];const all={};const walk=(d,r)=>{let n=[];try{n=fs.readdirSync(d).sort()}catch{return}for(const x of n){const f=p.join(d,x),k=r?r+"/"+x:x;let s;try{s=fs.lstatSync(f)}catch{continue}if(s.isDirectory())walk(f,k);else if(s.isFile())all[k]=fs.readFileSync(f).toString("base64")}};walk(dir,"");const pack=(o)=>z.gzipSync(JSON.stringify(o)).toString("base64");let b=pack(all);if(b.length>CHUNK*PARTS){b=pack(Object.fromEntries(Object.entries(all).filter(([k])=>NOTE.includes(k))));if(b.length>CHUNK*PARTS){b=pack({});console.error("chant-commit: the report is too large to hand to the next job, even cut to decision.json, rc, output, change.patch; it hands on none of it")}else console.error("chant-commit: the report is too large to hand to the next job whole; it hands on decision.json, rc, output, change.patch")}let o="";for(let i=0;i*CHUNK<b.length;i++)o+="report_"+i+"="+b.slice(i*CHUNK,(i+1)*CHUNK)+"\n";fs.appendFileSync(out,o);' "$chant_report" "${GITHUB_OUTPUT:-/dev/null}" || echo "chant-commit: the report could not be handed to the next job" >&2; }
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:
env:
CHANT_CHECKOUT_TOKEN: '${{ github.token }}'
PR_NUMBER: '${{ github.event.issue.number }}'
run: |
run: |-
set -eu
git config --global --add safe.directory "$PWD" 2>/dev/null || true
[ -d .git ] || git init -q .
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
case "$PR_NUMBER" in ''|*[!0-9]*) echo "no pull request number" >&2; exit 1 ;; esac
git -c protocol.version=2 fetch -q --no-tags origin "+refs/pull/$PR_NUMBER/head:refs/chant/commit-head"
- name: Take the change from the commit job
run: |
run: |-
set -u
node -e 'const fs=require("fs"),p=require("path"),z=require("zlib");const dir=process.argv[1];let b="";for(const l of fs.readFileSync(0,"utf8").split("\n")){if(!l.trim())continue;let s="";try{s=JSON.parse(l)}catch{}if(typeof s==="string")b+=s}if(!b){console.log("chant: the yodel-new job handed on no report");process.exit(0)}let files;try{files=JSON.parse(z.gunzipSync(Buffer.from(b,"base64"),{maxOutputLength:268435456}).toString("utf8"))}catch(e){console.log("chant: the report the yodel-new job handed on does not read: "+e.message);process.exit(0)}if(!files||typeof files!=="object"||Array.isArray(files)){console.log("chant: the report the yodel-new job handed on is not a set of files");process.exit(0)}let n=0;for(const [k,v] of Object.entries(files)){const parts=k.split("/");if(typeof v!=="string"||k.length>1024||parts.some((x)=>!x||x==="."||x===".."||/[\\\x00-\x1f]/.test(x))){console.log("chant: left out "+JSON.stringify(k));continue}try{const f=p.join(dir,...parts);fs.mkdirSync(p.dirname(f),{recursive:true});fs.writeFileSync(f,Buffer.from(v,"base64"));n++}catch(e){console.log("chant: could not write "+JSON.stringify(k)+": "+e.message)}}console.log("chant: took "+n+" report files from the yodel-new job")' .chant/commit <<'END_OF_REPORT'
${{ toJSON(needs.yodel-new.outputs.report_0) }}
Expand All @@ -154,7 +154,7 @@ jobs:
CHANT_COMMIT_TOKEN: '${{ secrets.YODEL_PUSH_TOKEN }}'
GITHUB_TOKEN: '${{ secrets.YODEL_PUSH_TOKEN }}'
CHANT_FORGEJO_TOKEN: '${{ secrets.YODEL_PUSH_TOKEN }}'
run: |
run: |-
chant_auth="$(printf 'x-access-token:%s' "$CHANT_COMMIT_TOKEN" | base64 | tr -d '\n')"
export GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=http.extraheader GIT_CONFIG_VALUE_0="AUTHORIZATION: basic $chant_auth"
unset chant_auth
Expand Down
Loading
Loading