@r5n/sisyphus 0.8.1 → 0.9.0
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/README.md +42 -12
- package/dist/cli.js +184 -170
- package/dist/templates/github/sis-create-stone.yml +2 -2
- package/dist/templates/github/sis-release.yml +41 -4
- package/dist/templates/gitlab/sis-release.yml +21 -2
- package/package.json +5 -1
- package/schema.json +174 -0
|
@@ -19,7 +19,7 @@ jobs:
|
|
|
19
19
|
contents: write
|
|
20
20
|
pull-requests: write
|
|
21
21
|
steps:
|
|
22
|
-
- uses: actions/checkout@
|
|
22
|
+
- uses: actions/checkout@v7
|
|
23
23
|
with:
|
|
24
24
|
fetch-depth: 0
|
|
25
25
|
|
|
@@ -68,7 +68,7 @@ jobs:
|
|
|
68
68
|
contents: write
|
|
69
69
|
pull-requests: write
|
|
70
70
|
steps:
|
|
71
|
-
- uses: actions/checkout@
|
|
71
|
+
- uses: actions/checkout@v7
|
|
72
72
|
with:
|
|
73
73
|
fetch-depth: 0
|
|
74
74
|
|
|
@@ -6,25 +6,62 @@ on:
|
|
|
6
6
|
types: [closed]
|
|
7
7
|
branches: [main]
|
|
8
8
|
|
|
9
|
+
concurrency:
|
|
10
|
+
group: sisyphus-release
|
|
11
|
+
cancel-in-progress: false
|
|
12
|
+
|
|
9
13
|
jobs:
|
|
10
14
|
release:
|
|
11
15
|
if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'sisyphus-release'))
|
|
12
16
|
runs-on: ubuntu-latest
|
|
13
17
|
permissions:
|
|
14
18
|
contents: write
|
|
15
|
-
|
|
19
|
+
id-token: write
|
|
16
20
|
steps:
|
|
17
|
-
- uses: actions/checkout@
|
|
21
|
+
- uses: actions/checkout@v7
|
|
18
22
|
with:
|
|
19
23
|
fetch-depth: 0
|
|
20
24
|
|
|
21
25
|
- uses: oven-sh/setup-bun@v2
|
|
22
26
|
|
|
27
|
+
- name: Restore release state
|
|
28
|
+
uses: actions/cache/restore@v5
|
|
29
|
+
with:
|
|
30
|
+
path: .git/sisyphus/release
|
|
31
|
+
key: sisyphus-release-${{ runner.os }}-${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt }}
|
|
32
|
+
restore-keys: sisyphus-release-${{ runner.os }}-${{ github.sha }}-
|
|
33
|
+
|
|
34
|
+
- name: Remove cached release lock
|
|
35
|
+
run: rm -f .git/sisyphus/release/.write.lock .git/sisyphus/release/.write.lock.*.owner .git/sisyphus/release/.write.lock.*.claim
|
|
36
|
+
|
|
37
|
+
- uses: actions/setup-node@v6
|
|
38
|
+
with:
|
|
39
|
+
node-version: 24
|
|
40
|
+
registry-url: https://registry.npmjs.org
|
|
41
|
+
|
|
42
|
+
- name: Install npm 11
|
|
43
|
+
run: npm install --global npm@11.5.1
|
|
44
|
+
|
|
23
45
|
- name: Install dependencies
|
|
24
46
|
run: bun install
|
|
25
47
|
|
|
48
|
+
- name: Install Sisyphus
|
|
49
|
+
run: bun add --global @r5n/sisyphus
|
|
50
|
+
|
|
26
51
|
- name: Publish release
|
|
27
|
-
run:
|
|
52
|
+
run: |
|
|
53
|
+
if [ -f .git/sisyphus/release/active.json ]; then
|
|
54
|
+
sis roll --resume
|
|
55
|
+
else
|
|
56
|
+
sis roll --publish-only --yes
|
|
57
|
+
fi
|
|
28
58
|
env:
|
|
29
59
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
30
|
-
|
|
60
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
61
|
+
|
|
62
|
+
- name: Save release state
|
|
63
|
+
if: always()
|
|
64
|
+
uses: actions/cache/save@v5
|
|
65
|
+
with:
|
|
66
|
+
path: .git/sisyphus/release
|
|
67
|
+
key: sisyphus-release-${{ runner.os }}-${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt }}
|
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
release:
|
|
2
2
|
stage: sisyphus
|
|
3
3
|
image: oven/bun:alpine
|
|
4
|
+
resource_group: sisyphus-release
|
|
5
|
+
cache:
|
|
6
|
+
key: "sisyphus-release-$CI_COMMIT_SHA"
|
|
7
|
+
policy: pull-push
|
|
8
|
+
when: always
|
|
9
|
+
paths:
|
|
10
|
+
- .git/sisyphus/release/
|
|
4
11
|
before_script:
|
|
5
|
-
- apk add --no-cache git
|
|
12
|
+
- apk add --no-cache git nodejs npm
|
|
13
|
+
- rm -f .git/sisyphus/release/.write.lock .git/sisyphus/release/.write.lock.*.owner .git/sisyphus/release/.write.lock.*.claim
|
|
14
|
+
- npm install --global npm@11.5.1
|
|
15
|
+
- npm config set //registry.npmjs.org/:_authToken "$NPM_TOKEN"
|
|
16
|
+
# release.tags / release.push need a push credential: CI_JOB_TOKEN cannot push, and Sisyphus
|
|
17
|
+
# rejects the token-embedded checkout URL. Set SIS_PUSH_TOKEN (project access token with
|
|
18
|
+
# write_repository scope) as a masked CI/CD variable to enable tag and branch pushes.
|
|
19
|
+
- |
|
|
20
|
+
if [ -n "$SIS_PUSH_TOKEN" ]; then
|
|
21
|
+
git remote set-url origin "https://${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git"
|
|
22
|
+
git config credential.helper '!f() { echo "username=oauth2"; echo "password=${SIS_PUSH_TOKEN}"; }; f'
|
|
23
|
+
fi
|
|
6
24
|
rules:
|
|
7
25
|
- if: $CI_PIPELINE_SOURCE == "web"
|
|
8
26
|
when: manual
|
|
@@ -10,4 +28,5 @@ release:
|
|
|
10
28
|
script:
|
|
11
29
|
- git fetch --unshallow || true
|
|
12
30
|
- bun install
|
|
13
|
-
-
|
|
31
|
+
- bun add --global @r5n/sisyphus
|
|
32
|
+
- if [ -f .git/sisyphus/release/active.json ]; then sis roll --resume; else sis roll --publish-only --yes; fi
|
package/package.json
CHANGED
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
"license": "Apache-2.0",
|
|
13
13
|
"main": "dist/cli.js",
|
|
14
14
|
"name": "@r5n/sisyphus",
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public",
|
|
17
|
+
"registry": "https://registry.npmjs.org/"
|
|
18
|
+
},
|
|
15
19
|
"repository": {
|
|
16
20
|
"type": "git",
|
|
17
21
|
"url": "git+https://github.com/r5n-labs/clis.git"
|
|
@@ -27,5 +31,5 @@
|
|
|
27
31
|
},
|
|
28
32
|
"type": "module",
|
|
29
33
|
"types": "src/cli.ts",
|
|
30
|
-
"version": "0.
|
|
34
|
+
"version": "0.9.0"
|
|
31
35
|
}
|
package/schema.json
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/r5n-labs/clis/refs/heads/develop/packages/sisyphus/schema.json",
|
|
4
|
+
"title": "Sisyphus configuration",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"$schema": { "type": "string" },
|
|
8
|
+
"single": { "type": "boolean" },
|
|
9
|
+
"tag": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"pattern": "^[A-Za-z][0-9A-Za-z._-]*$",
|
|
12
|
+
"not": { "pattern": "^(?:[vV]?\\d+(?:\\.(?:\\d+|[xX*])){0,2}(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?|[xX])$" }
|
|
13
|
+
},
|
|
14
|
+
"sisyphusDir": { "type": "string", "minLength": 1 },
|
|
15
|
+
"stonesPath": { "type": "string", "minLength": 1 },
|
|
16
|
+
"ignore": { "type": "array", "items": { "type": "string" }, "uniqueItems": true },
|
|
17
|
+
"plugins": { "type": "array", "items": { "type": "string" }, "uniqueItems": true },
|
|
18
|
+
"stones": {
|
|
19
|
+
"type": "array",
|
|
20
|
+
"items": { "type": "string", "pattern": "^[0-9A-Za-z][0-9A-Za-z_-]*$" },
|
|
21
|
+
"uniqueItems": true
|
|
22
|
+
},
|
|
23
|
+
"lastStone": {
|
|
24
|
+
"type": "object",
|
|
25
|
+
"additionalProperties": false,
|
|
26
|
+
"required": ["commit", "date"],
|
|
27
|
+
"properties": { "commit": { "type": "string" }, "date": { "type": "string" } }
|
|
28
|
+
},
|
|
29
|
+
"commit": {
|
|
30
|
+
"type": "object",
|
|
31
|
+
"additionalProperties": false,
|
|
32
|
+
"required": ["author", "message"],
|
|
33
|
+
"properties": {
|
|
34
|
+
"author": { "type": "string" },
|
|
35
|
+
"email": { "type": "string" },
|
|
36
|
+
"message": { "type": "string", "minLength": 1 }
|
|
37
|
+
},
|
|
38
|
+
"if": { "properties": { "author": { "pattern": "\\S" } } },
|
|
39
|
+
"then": {
|
|
40
|
+
"required": ["email"],
|
|
41
|
+
"properties": { "email": { "pattern": "^[^\\s<>@]+@[^\\s<>@]+\\.[^\\s<>@]+$" } }
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"release": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"required": ["createRelease", "npm", "push", "tags"],
|
|
48
|
+
"properties": {
|
|
49
|
+
"createRelease": { "type": "boolean" },
|
|
50
|
+
"npm": { "type": "boolean" },
|
|
51
|
+
"push": { "type": "boolean" },
|
|
52
|
+
"tags": { "type": "boolean" }
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"changelog": {
|
|
56
|
+
"type": "object",
|
|
57
|
+
"additionalProperties": false,
|
|
58
|
+
"required": ["append", "filename", "generate", "packageHeader", "root", "rootHeader", "sections"],
|
|
59
|
+
"properties": {
|
|
60
|
+
"append": { "type": "boolean" },
|
|
61
|
+
"filename": { "type": "string", "minLength": 1 },
|
|
62
|
+
"generate": { "type": "boolean" },
|
|
63
|
+
"packageHeader": { "type": "string" },
|
|
64
|
+
"root": { "type": "boolean" },
|
|
65
|
+
"rootHeader": { "type": "string" },
|
|
66
|
+
"template": { "type": "string" },
|
|
67
|
+
"sections": {
|
|
68
|
+
"type": "object",
|
|
69
|
+
"additionalProperties": false,
|
|
70
|
+
"required": [
|
|
71
|
+
"breaking",
|
|
72
|
+
"build",
|
|
73
|
+
"chore",
|
|
74
|
+
"ci",
|
|
75
|
+
"dependencies",
|
|
76
|
+
"docs",
|
|
77
|
+
"feat",
|
|
78
|
+
"fix",
|
|
79
|
+
"other",
|
|
80
|
+
"perf",
|
|
81
|
+
"refactor",
|
|
82
|
+
"style",
|
|
83
|
+
"test"
|
|
84
|
+
],
|
|
85
|
+
"properties": {
|
|
86
|
+
"breaking": { "type": "string" },
|
|
87
|
+
"build": { "type": "string" },
|
|
88
|
+
"chore": { "type": "string" },
|
|
89
|
+
"ci": { "type": "string" },
|
|
90
|
+
"dependencies": { "type": "string" },
|
|
91
|
+
"docs": { "type": "string" },
|
|
92
|
+
"feat": { "type": "string" },
|
|
93
|
+
"fix": { "type": "string" },
|
|
94
|
+
"other": { "type": "string" },
|
|
95
|
+
"perf": { "type": "string" },
|
|
96
|
+
"refactor": { "type": "string" },
|
|
97
|
+
"style": { "type": "string" },
|
|
98
|
+
"test": { "type": "string" }
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"scripts": {
|
|
104
|
+
"type": "object",
|
|
105
|
+
"additionalProperties": false,
|
|
106
|
+
"required": ["pre", "post"],
|
|
107
|
+
"properties": {
|
|
108
|
+
"pre": { "type": "object", "additionalProperties": { "type": "string" } },
|
|
109
|
+
"post": { "type": "object", "additionalProperties": { "type": "string" } }
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"commits": {
|
|
113
|
+
"type": "object",
|
|
114
|
+
"additionalProperties": false,
|
|
115
|
+
"required": ["skip"],
|
|
116
|
+
"properties": {
|
|
117
|
+
"skip": {
|
|
118
|
+
"type": "object",
|
|
119
|
+
"additionalProperties": false,
|
|
120
|
+
"required": ["authors", "messagePatterns"],
|
|
121
|
+
"properties": {
|
|
122
|
+
"authors": { "type": "array", "items": { "type": "string" } },
|
|
123
|
+
"messagePatterns": { "type": "array", "items": { "type": "string" } }
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"pr": {
|
|
129
|
+
"type": "object",
|
|
130
|
+
"additionalProperties": false,
|
|
131
|
+
"required": ["labelMapping", "skip"],
|
|
132
|
+
"properties": {
|
|
133
|
+
"labelMapping": { "type": "object", "additionalProperties": { "enum": ["major", "minor", "patch"] } },
|
|
134
|
+
"skip": {
|
|
135
|
+
"type": "object",
|
|
136
|
+
"additionalProperties": false,
|
|
137
|
+
"required": ["authors", "labels", "titlePatterns"],
|
|
138
|
+
"properties": {
|
|
139
|
+
"authors": { "type": "array", "items": { "type": "string" } },
|
|
140
|
+
"labels": { "type": "array", "items": { "type": "string" } },
|
|
141
|
+
"titlePatterns": { "type": "array", "items": { "type": "string" } }
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"currentRelease": {
|
|
147
|
+
"type": "object",
|
|
148
|
+
"additionalProperties": false,
|
|
149
|
+
"required": ["packages", "planHash", "sourceHash", "stoneIds", "timestamp"],
|
|
150
|
+
"properties": {
|
|
151
|
+
"packages": {
|
|
152
|
+
"type": "object",
|
|
153
|
+
"additionalProperties": {
|
|
154
|
+
"type": "object",
|
|
155
|
+
"additionalProperties": false,
|
|
156
|
+
"required": ["oldVersion", "newVersion"],
|
|
157
|
+
"properties": {
|
|
158
|
+
"oldVersion": { "type": "string", "minLength": 1 },
|
|
159
|
+
"newVersion": { "type": "string", "minLength": 1 }
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"planHash": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
|
|
164
|
+
"sourceHash": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
|
|
165
|
+
"stoneIds": {
|
|
166
|
+
"type": "array",
|
|
167
|
+
"items": { "type": "string", "pattern": "^[0-9A-Za-z][0-9A-Za-z_-]*$" },
|
|
168
|
+
"uniqueItems": true
|
|
169
|
+
},
|
|
170
|
+
"timestamp": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}-\\d{2}-\\d{2}-\\d{3}Z$" }
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|