@r5n/sisyphus 0.9.1 → 0.10.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 +59 -2
- package/dist/cli.js +169 -170
- package/dist/templates/github/sis-create-stone.yml +14 -8
- package/dist/templates/gitlab/sis-create-stone.yml +25 -11
- package/package.json +1 -1
- package/schema.json +46 -1
|
@@ -28,6 +28,9 @@ jobs:
|
|
|
28
28
|
- name: Install dependencies
|
|
29
29
|
run: bun install
|
|
30
30
|
|
|
31
|
+
- name: Install Sisyphus
|
|
32
|
+
run: bun add --global @r5n/sisyphus
|
|
33
|
+
|
|
31
34
|
- name: Configure git
|
|
32
35
|
run: |
|
|
33
36
|
git config user.name "r5n-bot[bot]"
|
|
@@ -36,14 +39,14 @@ jobs:
|
|
|
36
39
|
- name: Create stone from PR
|
|
37
40
|
id: stone
|
|
38
41
|
run: |
|
|
39
|
-
OUTPUT=$(
|
|
42
|
+
OUTPUT=$(sis pr --url "${{ github.event.pull_request.html_url }}" --yes 2>&1) && EXIT_CODE=0 || EXIT_CODE=$?
|
|
40
43
|
echo "$OUTPUT"
|
|
41
44
|
if echo "$OUTPUT" | grep -q "Skipping:"; then
|
|
42
|
-
echo "skipped=true" >> $GITHUB_OUTPUT
|
|
45
|
+
echo "skipped=true" >> "$GITHUB_OUTPUT"
|
|
43
46
|
else
|
|
44
|
-
echo "skipped=false" >> $GITHUB_OUTPUT
|
|
45
|
-
if [ $EXIT_CODE -ne 0 ]; then
|
|
46
|
-
exit $EXIT_CODE
|
|
47
|
+
echo "skipped=false" >> "$GITHUB_OUTPUT"
|
|
48
|
+
if [ "$EXIT_CODE" -ne 0 ]; then
|
|
49
|
+
exit "$EXIT_CODE"
|
|
47
50
|
fi
|
|
48
51
|
fi
|
|
49
52
|
env:
|
|
@@ -52,12 +55,12 @@ jobs:
|
|
|
52
55
|
- name: Commit and push stone
|
|
53
56
|
if: steps.stone.outputs.skipped == 'false'
|
|
54
57
|
run: |
|
|
55
|
-
git add .sisyphus/
|
|
58
|
+
git add .sisyphus/
|
|
56
59
|
git diff --cached --quiet || (git commit -m "chore: add stone from PR #${{ github.event.pull_request.number }}" && git push)
|
|
57
60
|
|
|
58
61
|
- name: Create or update release PR
|
|
59
62
|
if: steps.stone.outputs.skipped == 'false'
|
|
60
|
-
run:
|
|
63
|
+
run: sis actions release-pr
|
|
61
64
|
env:
|
|
62
65
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
63
66
|
|
|
@@ -77,12 +80,15 @@ jobs:
|
|
|
77
80
|
- name: Install dependencies
|
|
78
81
|
run: bun install
|
|
79
82
|
|
|
83
|
+
- name: Install Sisyphus
|
|
84
|
+
run: bun add --global @r5n/sisyphus
|
|
85
|
+
|
|
80
86
|
- name: Configure git
|
|
81
87
|
run: |
|
|
82
88
|
git config user.name "r5n-bot[bot]"
|
|
83
89
|
git config user.email "r5n-bot[bot]@users.noreply.github.com"
|
|
84
90
|
|
|
85
91
|
- name: Update release PR
|
|
86
|
-
run:
|
|
92
|
+
run: sis actions release-pr
|
|
87
93
|
env:
|
|
88
94
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -1,13 +1,30 @@
|
|
|
1
1
|
handle-merge:
|
|
2
2
|
stage: sisyphus
|
|
3
3
|
image: oven/bun:alpine
|
|
4
|
-
before_script:
|
|
4
|
+
before_script: &sisyphus_before_script
|
|
5
5
|
- apk add --no-cache git
|
|
6
|
+
- |
|
|
7
|
+
if [ -z "${GITLAB_TOKEN:-}" ]; then
|
|
8
|
+
echo "Set GITLAB_TOKEN with api and write_repository access to create release merge requests" >&2
|
|
9
|
+
exit 1
|
|
10
|
+
fi
|
|
11
|
+
export SIS_PUSH_TOKEN="${SIS_PUSH_TOKEN:-$GITLAB_TOKEN}"
|
|
12
|
+
git remote set-url origin "${CI_SERVER_URL}/${CI_PROJECT_PATH}.git"
|
|
13
|
+
git config credential.helper ''
|
|
14
|
+
git config --add credential.helper '!f() { echo "username=oauth2"; echo "password=${SIS_PUSH_TOKEN}"; }; f'
|
|
15
|
+
- bun add --global @r5n/sisyphus
|
|
6
16
|
rules:
|
|
7
17
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_TITLE =~ /^Merge branch/ && $CI_COMMIT_TITLE !~ /sisyphus\/release/
|
|
8
18
|
script:
|
|
9
19
|
- |
|
|
10
|
-
MR_IID=$(
|
|
20
|
+
MR_IID=$(printf '%s\n' "$CI_COMMIT_DESCRIPTION" | awk -v prefix="See merge request ${CI_PROJECT_PATH}!" '
|
|
21
|
+
index($0, prefix) == 1 {
|
|
22
|
+
value = substr($0, length(prefix) + 1)
|
|
23
|
+
sub(/[[:space:]]+$/, "", value)
|
|
24
|
+
if (value ~ /^[0-9]+$/) iid = value
|
|
25
|
+
}
|
|
26
|
+
END { print iid }
|
|
27
|
+
')
|
|
11
28
|
if [ -z "$MR_IID" ]; then
|
|
12
29
|
echo "No MR IID found in commit description, skipping"
|
|
13
30
|
exit 0
|
|
@@ -18,9 +35,7 @@ handle-merge:
|
|
|
18
35
|
- git config user.email "r5n-bot[bot]@users.noreply.gitlab.com"
|
|
19
36
|
- bun install
|
|
20
37
|
- |
|
|
21
|
-
|
|
22
|
-
GIT_USER=$([ -n "$GITLAB_TOKEN" ] && echo "oauth2" || echo "gitlab-ci-token")
|
|
23
|
-
OUTPUT=$(bunx @r5n/sisyphus pr --url $CI_PROJECT_URL/-/merge_requests/$MR_IID --yes 2>&1) && EXIT_CODE=0 || EXIT_CODE=$?
|
|
38
|
+
OUTPUT=$(sis pr --url "$CI_PROJECT_URL/-/merge_requests/$MR_IID" --yes 2>&1) && EXIT_CODE=0 || EXIT_CODE=$?
|
|
24
39
|
echo "$OUTPUT"
|
|
25
40
|
if echo "$OUTPUT" | grep -q "Skipping:"; then
|
|
26
41
|
echo "Stone creation skipped"
|
|
@@ -29,16 +44,15 @@ handle-merge:
|
|
|
29
44
|
if [ $EXIT_CODE -ne 0 ]; then
|
|
30
45
|
exit $EXIT_CODE
|
|
31
46
|
fi
|
|
32
|
-
git add .sisyphus/
|
|
47
|
+
git add .sisyphus/
|
|
33
48
|
git diff --cached --quiet || git commit -m 'chore: add stone from MR !'"$MR_IID"
|
|
34
|
-
git push "
|
|
35
|
-
|
|
49
|
+
git push origin "HEAD:$CI_DEFAULT_BRANCH"
|
|
50
|
+
sis actions release-pr
|
|
36
51
|
|
|
37
52
|
handle-push:
|
|
38
53
|
stage: sisyphus
|
|
39
54
|
image: oven/bun:alpine
|
|
40
|
-
before_script:
|
|
41
|
-
- apk add --no-cache git
|
|
55
|
+
before_script: *sisyphus_before_script
|
|
42
56
|
rules:
|
|
43
57
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_TITLE !~ /^Merge branch/
|
|
44
58
|
script:
|
|
@@ -46,4 +60,4 @@ handle-push:
|
|
|
46
60
|
- git config user.name "r5n-bot[bot]"
|
|
47
61
|
- git config user.email "r5n-bot[bot]@users.noreply.gitlab.com"
|
|
48
62
|
- bun install
|
|
49
|
-
-
|
|
63
|
+
- sis actions release-pr
|
package/package.json
CHANGED
package/schema.json
CHANGED
|
@@ -13,7 +13,29 @@
|
|
|
13
13
|
},
|
|
14
14
|
"sisyphusDir": { "type": "string", "minLength": 1 },
|
|
15
15
|
"stonesPath": { "type": "string", "minLength": 1 },
|
|
16
|
-
"ignore": {
|
|
16
|
+
"ignore": {
|
|
17
|
+
"type": "array",
|
|
18
|
+
"description": "Package names or globs that are never released. Globs use path semantics, so scoped names need '@scope/*' rather than '*'.",
|
|
19
|
+
"items": { "type": "string", "minLength": 1 },
|
|
20
|
+
"uniqueItems": true
|
|
21
|
+
},
|
|
22
|
+
"dependents": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"additionalProperties": false,
|
|
25
|
+
"description": "How dependent packages are pulled into a release.",
|
|
26
|
+
"properties": {
|
|
27
|
+
"kinds": {
|
|
28
|
+
"type": "array",
|
|
29
|
+
"description": "Manifest sections whose workspace dependencies make a dependent releasable. Keep 'devDependencies' when packages are bundled at build time; drop it when only the published manifest matters.",
|
|
30
|
+
"items": { "enum": ["dependencies", "devDependencies", "optionalDependencies", "peerDependencies"] },
|
|
31
|
+
"uniqueItems": true
|
|
32
|
+
},
|
|
33
|
+
"updateInternal": {
|
|
34
|
+
"enum": ["always", "outOfRange"],
|
|
35
|
+
"description": "'always' releases every dependent; 'outOfRange' releases a dependent only when its published range no longer admits the new version. A literal 'workspace:<range>' is never rewritten by a release, so it never triggers one."
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
17
39
|
"plugins": { "type": "array", "items": { "type": "string" }, "uniqueItems": true },
|
|
18
40
|
"stones": {
|
|
19
41
|
"type": "array",
|
|
@@ -38,6 +60,29 @@
|
|
|
38
60
|
"type": "object",
|
|
39
61
|
"additionalProperties": false,
|
|
40
62
|
"properties": {
|
|
63
|
+
"build": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"additionalProperties": false,
|
|
66
|
+
"description": "How package artifacts are built before packing.",
|
|
67
|
+
"properties": {
|
|
68
|
+
"command": {
|
|
69
|
+
"type": "array",
|
|
70
|
+
"description": "Argv for the per-package build, run in the package directory. An empty array disables it.",
|
|
71
|
+
"items": { "type": "string", "minLength": 1 }
|
|
72
|
+
},
|
|
73
|
+
"outputs": {
|
|
74
|
+
"type": "array",
|
|
75
|
+
"description": "Repository-root-relative globs written by the release build. They are cleaned before the build and exempted from the ignored-input and pack-input guards.",
|
|
76
|
+
"items": { "type": "string", "minLength": 1, "not": { "pattern": "^(\\.\\.?/|/)" } },
|
|
77
|
+
"uniqueItems": true
|
|
78
|
+
},
|
|
79
|
+
"root": {
|
|
80
|
+
"type": "array",
|
|
81
|
+
"description": "Argv arrays run once at the repository root before the first package is packed.",
|
|
82
|
+
"items": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } }
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
41
86
|
"createRelease": { "type": "boolean" },
|
|
42
87
|
"npm": { "type": "boolean" },
|
|
43
88
|
"push": { "type": "boolean" },
|