@owenlamont/ryl 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/.github/CODEOWNERS +1 -0
- package/.github/dependabot.yml +13 -0
- package/.github/workflows/ci.yml +107 -0
- package/.github/workflows/release.yml +613 -0
- package/.github/workflows/update_dependencies.yml +61 -0
- package/.github/workflows/update_linters.yml +56 -0
- package/.pre-commit-config.yaml +87 -0
- package/.yamllint +4 -0
- package/AGENTS.md +200 -0
- package/Cargo.lock +908 -0
- package/Cargo.toml +32 -0
- package/LICENSE +21 -0
- package/README.md +230 -0
- package/bin/ryl.js +1 -0
- package/clippy.toml +1 -0
- package/docs/config-presets.md +100 -0
- package/img/benchmark-5x5-5runs.svg +2176 -0
- package/package.json +28 -0
- package/pyproject.toml +42 -0
- package/ruff.toml +107 -0
- package/rumdl.toml +20 -0
- package/rust-toolchain.toml +3 -0
- package/rustfmt.toml +3 -0
- package/scripts/benchmark_perf_vs_yamllint.py +400 -0
- package/scripts/coverage-missing.ps1 +80 -0
- package/scripts/coverage-missing.sh +60 -0
- package/src/bin/discover_config_bin.rs +24 -0
- package/src/cli_support.rs +33 -0
- package/src/conf/mod.rs +85 -0
- package/src/config.rs +2099 -0
- package/src/decoder.rs +326 -0
- package/src/discover.rs +31 -0
- package/src/lib.rs +19 -0
- package/src/lint.rs +558 -0
- package/src/main.rs +535 -0
- package/src/migrate.rs +233 -0
- package/src/rules/anchors.rs +517 -0
- package/src/rules/braces.rs +77 -0
- package/src/rules/brackets.rs +77 -0
- package/src/rules/colons.rs +475 -0
- package/src/rules/commas.rs +372 -0
- package/src/rules/comments.rs +299 -0
- package/src/rules/comments_indentation.rs +243 -0
- package/src/rules/document_end.rs +175 -0
- package/src/rules/document_start.rs +84 -0
- package/src/rules/empty_lines.rs +152 -0
- package/src/rules/empty_values.rs +255 -0
- package/src/rules/float_values.rs +259 -0
- package/src/rules/flow_collection.rs +562 -0
- package/src/rules/hyphens.rs +104 -0
- package/src/rules/indentation.rs +803 -0
- package/src/rules/key_duplicates.rs +218 -0
- package/src/rules/key_ordering.rs +303 -0
- package/src/rules/line_length.rs +326 -0
- package/src/rules/mod.rs +25 -0
- package/src/rules/new_line_at_end_of_file.rs +23 -0
- package/src/rules/new_lines.rs +95 -0
- package/src/rules/octal_values.rs +121 -0
- package/src/rules/quoted_strings.rs +577 -0
- package/src/rules/span_utils.rs +37 -0
- package/src/rules/trailing_spaces.rs +65 -0
- package/src/rules/truthy.rs +420 -0
- package/tests/brackets_carriage_return.rs +114 -0
- package/tests/build_global_cfg_error.rs +23 -0
- package/tests/cli_anchors_rule.rs +143 -0
- package/tests/cli_braces_rule.rs +104 -0
- package/tests/cli_brackets_rule.rs +104 -0
- package/tests/cli_colons_rule.rs +65 -0
- package/tests/cli_commas_rule.rs +104 -0
- package/tests/cli_comments_indentation_rule.rs +61 -0
- package/tests/cli_comments_rule.rs +67 -0
- package/tests/cli_config_data_error.rs +30 -0
- package/tests/cli_config_flags.rs +66 -0
- package/tests/cli_config_migrate.rs +229 -0
- package/tests/cli_document_end_rule.rs +92 -0
- package/tests/cli_document_start_rule.rs +92 -0
- package/tests/cli_empty_lines_rule.rs +87 -0
- package/tests/cli_empty_values_rule.rs +68 -0
- package/tests/cli_env_config.rs +34 -0
- package/tests/cli_exit_and_errors.rs +41 -0
- package/tests/cli_file_encoding.rs +203 -0
- package/tests/cli_float_values_rule.rs +64 -0
- package/tests/cli_format_options.rs +316 -0
- package/tests/cli_global_cfg_relaxed.rs +20 -0
- package/tests/cli_hyphens_rule.rs +104 -0
- package/tests/cli_indentation_rule.rs +65 -0
- package/tests/cli_invalid_project_config.rs +39 -0
- package/tests/cli_key_duplicates_rule.rs +104 -0
- package/tests/cli_key_ordering_rule.rs +59 -0
- package/tests/cli_line_length_rule.rs +85 -0
- package/tests/cli_list_files.rs +29 -0
- package/tests/cli_new_line_rule.rs +141 -0
- package/tests/cli_new_lines_rule.rs +119 -0
- package/tests/cli_octal_values_rule.rs +60 -0
- package/tests/cli_quoted_strings_rule.rs +47 -0
- package/tests/cli_toml_config.rs +119 -0
- package/tests/cli_trailing_spaces_rule.rs +77 -0
- package/tests/cli_truthy_rule.rs +83 -0
- package/tests/cli_yaml_files_negation.rs +45 -0
- package/tests/colons_rule.rs +303 -0
- package/tests/common/compat.rs +114 -0
- package/tests/common/fake_env.rs +93 -0
- package/tests/common/mod.rs +1 -0
- package/tests/conf_builtin.rs +9 -0
- package/tests/config_anchors.rs +84 -0
- package/tests/config_braces.rs +121 -0
- package/tests/config_brackets.rs +127 -0
- package/tests/config_commas.rs +79 -0
- package/tests/config_comments.rs +65 -0
- package/tests/config_comments_indentation.rs +20 -0
- package/tests/config_deep_merge_nonstring_key.rs +24 -0
- package/tests/config_document_end.rs +54 -0
- package/tests/config_document_start.rs +55 -0
- package/tests/config_empty_lines.rs +48 -0
- package/tests/config_empty_values.rs +35 -0
- package/tests/config_env_errors.rs +23 -0
- package/tests/config_env_invalid_inline.rs +15 -0
- package/tests/config_env_missing.rs +63 -0
- package/tests/config_env_shim.rs +301 -0
- package/tests/config_explicit_file_parse_error.rs +55 -0
- package/tests/config_extended_features.rs +225 -0
- package/tests/config_extends_inline.rs +185 -0
- package/tests/config_extends_sequence.rs +18 -0
- package/tests/config_find_project_home_boundary.rs +54 -0
- package/tests/config_find_project_two_files_in_cwd.rs +47 -0
- package/tests/config_float_values.rs +34 -0
- package/tests/config_from_yaml_paths.rs +32 -0
- package/tests/config_hyphens.rs +51 -0
- package/tests/config_ignore_errors.rs +243 -0
- package/tests/config_ignore_overrides.rs +83 -0
- package/tests/config_indentation.rs +65 -0
- package/tests/config_invalid_globs.rs +16 -0
- package/tests/config_invalid_types.rs +19 -0
- package/tests/config_key_duplicates.rs +34 -0
- package/tests/config_key_ordering.rs +70 -0
- package/tests/config_line_length.rs +65 -0
- package/tests/config_locale.rs +111 -0
- package/tests/config_merge.rs +26 -0
- package/tests/config_new_lines.rs +89 -0
- package/tests/config_octal_values.rs +33 -0
- package/tests/config_quoted_strings.rs +195 -0
- package/tests/config_rule_level.rs +147 -0
- package/tests/config_rules_non_string_keys.rs +23 -0
- package/tests/config_scalar_overrides.rs +27 -0
- package/tests/config_to_toml.rs +110 -0
- package/tests/config_toml_coverage.rs +80 -0
- package/tests/config_toml_discovery.rs +304 -0
- package/tests/config_trailing_spaces.rs +152 -0
- package/tests/config_truthy.rs +77 -0
- package/tests/config_yaml_files.rs +62 -0
- package/tests/config_yaml_files_all_non_string.rs +15 -0
- package/tests/config_yaml_files_empty.rs +30 -0
- package/tests/coverage_commas.rs +46 -0
- package/tests/decoder_decode.rs +338 -0
- package/tests/discover_config_bin_all.rs +66 -0
- package/tests/discover_config_bin_env_invalid_yaml.rs +26 -0
- package/tests/discover_config_bin_project_config_parse_error.rs +24 -0
- package/tests/discover_config_bin_user_global_error.rs +26 -0
- package/tests/discover_module.rs +30 -0
- package/tests/discover_per_file_dir.rs +10 -0
- package/tests/discover_per_file_project_config_error.rs +21 -0
- package/tests/float_values.rs +43 -0
- package/tests/lint_multi_errors.rs +32 -0
- package/tests/main_yaml_ok_filtering.rs +30 -0
- package/tests/migrate_module.rs +259 -0
- package/tests/resolve_ctx_empty_parent.rs +16 -0
- package/tests/rule_anchors.rs +442 -0
- package/tests/rule_braces.rs +258 -0
- package/tests/rule_brackets.rs +217 -0
- package/tests/rule_commas.rs +205 -0
- package/tests/rule_comments.rs +197 -0
- package/tests/rule_comments_indentation.rs +127 -0
- package/tests/rule_document_end.rs +118 -0
- package/tests/rule_document_start.rs +60 -0
- package/tests/rule_empty_lines.rs +96 -0
- package/tests/rule_empty_values.rs +102 -0
- package/tests/rule_float_values.rs +109 -0
- package/tests/rule_hyphens.rs +65 -0
- package/tests/rule_indentation.rs +455 -0
- package/tests/rule_key_duplicates.rs +76 -0
- package/tests/rule_key_ordering.rs +207 -0
- package/tests/rule_line_length.rs +200 -0
- package/tests/rule_new_lines.rs +51 -0
- package/tests/rule_octal_values.rs +53 -0
- package/tests/rule_quoted_strings.rs +290 -0
- package/tests/rule_trailing_spaces.rs +41 -0
- package/tests/rule_truthy.rs +236 -0
- package/tests/user_global_invalid_yaml.rs +32 -0
- package/tests/yamllint_compat_anchors.rs +280 -0
- package/tests/yamllint_compat_braces.rs +411 -0
- package/tests/yamllint_compat_brackets.rs +364 -0
- package/tests/yamllint_compat_colons.rs +298 -0
- package/tests/yamllint_compat_colors.rs +80 -0
- package/tests/yamllint_compat_commas.rs +375 -0
- package/tests/yamllint_compat_comments.rs +167 -0
- package/tests/yamllint_compat_comments_indentation.rs +281 -0
- package/tests/yamllint_compat_config.rs +170 -0
- package/tests/yamllint_compat_document_end.rs +243 -0
- package/tests/yamllint_compat_document_start.rs +136 -0
- package/tests/yamllint_compat_empty_lines.rs +117 -0
- package/tests/yamllint_compat_empty_values.rs +179 -0
- package/tests/yamllint_compat_float_values.rs +216 -0
- package/tests/yamllint_compat_hyphens.rs +223 -0
- package/tests/yamllint_compat_indentation.rs +398 -0
- package/tests/yamllint_compat_key_duplicates.rs +139 -0
- package/tests/yamllint_compat_key_ordering.rs +170 -0
- package/tests/yamllint_compat_line_length.rs +375 -0
- package/tests/yamllint_compat_list.rs +127 -0
- package/tests/yamllint_compat_new_line.rs +133 -0
- package/tests/yamllint_compat_newline_types.rs +185 -0
- package/tests/yamllint_compat_octal_values.rs +172 -0
- package/tests/yamllint_compat_quoted_strings.rs +154 -0
- package/tests/yamllint_compat_syntax.rs +200 -0
- package/tests/yamllint_compat_trailing_spaces.rs +162 -0
- package/tests/yamllint_compat_truthy.rs +130 -0
- package/tests/yamllint_compat_yaml_files.rs +81 -0
- package/typos.toml +2 -0
|
@@ -0,0 +1,613 @@
|
|
|
1
|
+
name: Release Crate and Wheels
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ['v*']
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
inputs:
|
|
8
|
+
publish:
|
|
9
|
+
description: "Publish to PyPI and crates.io"
|
|
10
|
+
type: boolean
|
|
11
|
+
required: false
|
|
12
|
+
default: false
|
|
13
|
+
|
|
14
|
+
permissions:
|
|
15
|
+
contents: read
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
version-check:
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
|
22
|
+
- name: Verify version consistency
|
|
23
|
+
run: |
|
|
24
|
+
set -euo pipefail
|
|
25
|
+
EVENT_NAME="${GITHUB_EVENT_NAME}"
|
|
26
|
+
REF_NAME="${GITHUB_REF_NAME}"
|
|
27
|
+
TAG_VERSION=""
|
|
28
|
+
if [ "$EVENT_NAME" = "push" ] && [[ "$REF_NAME" == v* ]]; then
|
|
29
|
+
TAG_VERSION="${REF_NAME#v}" # drop 'v' prefix if present
|
|
30
|
+
fi
|
|
31
|
+
echo "Event: $EVENT_NAME"
|
|
32
|
+
echo "Ref name: $REF_NAME"
|
|
33
|
+
echo "Tag version: ${TAG_VERSION:-<none>}"
|
|
34
|
+
python - <<'PY'
|
|
35
|
+
import os, sys
|
|
36
|
+
try:
|
|
37
|
+
import tomllib # Python 3.11+
|
|
38
|
+
except Exception as e: # pragma: no cover
|
|
39
|
+
print("Python 3.11+ with tomllib is required", file=sys.stderr)
|
|
40
|
+
raise
|
|
41
|
+
|
|
42
|
+
def read_toml(path: str):
|
|
43
|
+
with open(path, 'rb') as f:
|
|
44
|
+
return tomllib.load(f)
|
|
45
|
+
|
|
46
|
+
tag = os.environ.get('TAG_VERSION', '')
|
|
47
|
+
cargo = read_toml('Cargo.toml')
|
|
48
|
+
pyproj = read_toml('pyproject.toml')
|
|
49
|
+
|
|
50
|
+
cargo_version = cargo.get('package', {}).get('version')
|
|
51
|
+
py_version = pyproj.get('project', {}).get('version')
|
|
52
|
+
|
|
53
|
+
print(f"Cargo.toml version: {cargo_version}")
|
|
54
|
+
print(f"pyproject.toml version: {py_version}")
|
|
55
|
+
|
|
56
|
+
ok = True
|
|
57
|
+
# Always ensure Cargo and pyproject match each other
|
|
58
|
+
if cargo_version != py_version:
|
|
59
|
+
print("❌ Cargo.toml and pyproject.toml versions differ", file=sys.stderr)
|
|
60
|
+
ok = False
|
|
61
|
+
# On tag builds, also enforce equality with the tag
|
|
62
|
+
if tag:
|
|
63
|
+
if cargo_version != tag:
|
|
64
|
+
print("❌ Cargo.toml version does not match tag", file=sys.stderr)
|
|
65
|
+
ok = False
|
|
66
|
+
if py_version != tag:
|
|
67
|
+
print("❌ pyproject.toml version does not match tag", file=sys.stderr)
|
|
68
|
+
ok = False
|
|
69
|
+
|
|
70
|
+
if not ok:
|
|
71
|
+
sys.exit(1)
|
|
72
|
+
|
|
73
|
+
print("✅ Versions are consistent")
|
|
74
|
+
PY
|
|
75
|
+
|
|
76
|
+
preflight-release-guard:
|
|
77
|
+
name: Preflight release guard
|
|
78
|
+
needs: [version-check]
|
|
79
|
+
if: >-
|
|
80
|
+
startsWith(github.ref, 'refs/tags/v') &&
|
|
81
|
+
(github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.publish == true))
|
|
82
|
+
runs-on: ubuntu-latest
|
|
83
|
+
environment: automation
|
|
84
|
+
permissions:
|
|
85
|
+
contents: read
|
|
86
|
+
steps:
|
|
87
|
+
- name: Ensure existing release (if any) is a draft
|
|
88
|
+
env:
|
|
89
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
90
|
+
RELEASE_TAG: ${{ github.ref_name }}
|
|
91
|
+
run: |
|
|
92
|
+
set -euo pipefail
|
|
93
|
+
release_query_err_file="$(mktemp)"
|
|
94
|
+
if release_is_draft="$(gh release view "${RELEASE_TAG}" -R "${GITHUB_REPOSITORY}" --json isDraft --jq '.isDraft' 2>"${release_query_err_file}")"; then
|
|
95
|
+
:
|
|
96
|
+
elif grep -Eq '404|not[[:space:]]+found' "${release_query_err_file}"; then
|
|
97
|
+
echo "No release exists for ${RELEASE_TAG}; continuing."
|
|
98
|
+
exit 0
|
|
99
|
+
else
|
|
100
|
+
echo "Failed to query release ${RELEASE_TAG}." >&2
|
|
101
|
+
cat "${release_query_err_file}" >&2
|
|
102
|
+
exit 1
|
|
103
|
+
fi
|
|
104
|
+
if [ "${release_is_draft}" = "true" ]; then
|
|
105
|
+
echo "Draft release ${RELEASE_TAG} already exists; continuing for rerun safety."
|
|
106
|
+
exit 0
|
|
107
|
+
fi
|
|
108
|
+
echo "Published release ${RELEASE_TAG} already exists; refusing to continue." >&2
|
|
109
|
+
exit 1
|
|
110
|
+
|
|
111
|
+
linux:
|
|
112
|
+
needs: [version-check]
|
|
113
|
+
runs-on: ubuntu-22.04
|
|
114
|
+
strategy:
|
|
115
|
+
matrix:
|
|
116
|
+
target: [x86_64, aarch64, armv7, i686, ppc64le, s390x]
|
|
117
|
+
steps:
|
|
118
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
|
119
|
+
- name: Build manylinux wheels
|
|
120
|
+
uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad
|
|
121
|
+
with:
|
|
122
|
+
target: ${{ matrix.target }}
|
|
123
|
+
args: --release --out dist
|
|
124
|
+
manylinux: auto
|
|
125
|
+
sccache: ${{ github.event_name != 'release' }}
|
|
126
|
+
- name: Upload wheels (manylinux)
|
|
127
|
+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
|
|
128
|
+
with:
|
|
129
|
+
name: wheels-manylinux-${{ matrix.target }}
|
|
130
|
+
path: dist
|
|
131
|
+
|
|
132
|
+
smoke-manylinux:
|
|
133
|
+
name: Smoke Test (manylinux)
|
|
134
|
+
needs: [linux]
|
|
135
|
+
runs-on: ubuntu-22.04
|
|
136
|
+
strategy:
|
|
137
|
+
matrix:
|
|
138
|
+
python: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"]
|
|
139
|
+
steps:
|
|
140
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
|
141
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
|
|
142
|
+
with:
|
|
143
|
+
pattern: wheels-manylinux-*
|
|
144
|
+
merge-multiple: true
|
|
145
|
+
path: dist
|
|
146
|
+
- name: Install uv
|
|
147
|
+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78
|
|
148
|
+
- name: Install wheel and run CLI
|
|
149
|
+
run: |
|
|
150
|
+
set -euxo pipefail
|
|
151
|
+
uv python install ${{ matrix.python }}
|
|
152
|
+
uv venv -p ${{ matrix.python }} .venv
|
|
153
|
+
uv pip install -p .venv --no-index --find-links dist ryl
|
|
154
|
+
uv run -p .venv ryl --version
|
|
155
|
+
|
|
156
|
+
musllinux:
|
|
157
|
+
needs: [version-check]
|
|
158
|
+
runs-on: ubuntu-22.04
|
|
159
|
+
strategy:
|
|
160
|
+
matrix:
|
|
161
|
+
target: [x86_64, aarch64]
|
|
162
|
+
steps:
|
|
163
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
|
164
|
+
- name: Build musllinux wheels
|
|
165
|
+
uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad
|
|
166
|
+
with:
|
|
167
|
+
target: ${{ matrix.target }}
|
|
168
|
+
args: --release --out dist
|
|
169
|
+
manylinux: musllinux_1_2
|
|
170
|
+
sccache: ${{ github.event_name != 'release' }}
|
|
171
|
+
- name: Upload wheels (musllinux)
|
|
172
|
+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
|
|
173
|
+
with:
|
|
174
|
+
name: wheels-musllinux-${{ matrix.target }}
|
|
175
|
+
path: dist
|
|
176
|
+
|
|
177
|
+
smoke-musllinux:
|
|
178
|
+
name: Smoke Test (musllinux)
|
|
179
|
+
needs: [musllinux]
|
|
180
|
+
runs-on: ubuntu-22.04
|
|
181
|
+
strategy:
|
|
182
|
+
matrix:
|
|
183
|
+
python_image: ["3.10-alpine", "3.11-alpine", "3.12-alpine", "3.13-alpine", "3.14-alpine"]
|
|
184
|
+
steps:
|
|
185
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
|
186
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
|
|
187
|
+
with:
|
|
188
|
+
pattern: wheels-musllinux-*
|
|
189
|
+
merge-multiple: true
|
|
190
|
+
path: dist
|
|
191
|
+
- name: Install wheel and run CLI in Alpine
|
|
192
|
+
run: |
|
|
193
|
+
set -euxo pipefail
|
|
194
|
+
docker run --rm -v "$PWD/dist":/dist python:${{ matrix.python_image }} \
|
|
195
|
+
sh -euxc "python --version; python -m pip install --no-index --find-links /dist ryl; ryl --version"
|
|
196
|
+
|
|
197
|
+
windows:
|
|
198
|
+
needs: [version-check]
|
|
199
|
+
runs-on: windows-latest
|
|
200
|
+
strategy:
|
|
201
|
+
matrix:
|
|
202
|
+
target: [x86_64, aarch64]
|
|
203
|
+
steps:
|
|
204
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
|
205
|
+
- name: Build Windows wheels
|
|
206
|
+
uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad
|
|
207
|
+
with:
|
|
208
|
+
target: ${{ matrix.target }}
|
|
209
|
+
args: --release --out dist
|
|
210
|
+
sccache: ${{ github.event_name != 'release' }}
|
|
211
|
+
- name: Upload wheels (Windows)
|
|
212
|
+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
|
|
213
|
+
with:
|
|
214
|
+
name: wheels-windows-${{ matrix.target }}
|
|
215
|
+
path: dist
|
|
216
|
+
|
|
217
|
+
smoke-windows:
|
|
218
|
+
name: Smoke Test (Windows)
|
|
219
|
+
needs: [windows]
|
|
220
|
+
runs-on: windows-latest
|
|
221
|
+
strategy:
|
|
222
|
+
matrix:
|
|
223
|
+
python: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"]
|
|
224
|
+
steps:
|
|
225
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
|
226
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
|
|
227
|
+
with:
|
|
228
|
+
pattern: wheels-windows-*
|
|
229
|
+
merge-multiple: true
|
|
230
|
+
path: dist
|
|
231
|
+
- name: Install uv
|
|
232
|
+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78
|
|
233
|
+
- name: Install wheel and run CLI
|
|
234
|
+
shell: bash
|
|
235
|
+
run: |
|
|
236
|
+
set -euxo pipefail
|
|
237
|
+
uv python install ${{ matrix.python }}
|
|
238
|
+
uv venv -p ${{ matrix.python }} .venv
|
|
239
|
+
uv pip install -p .venv --no-index --find-links dist ryl
|
|
240
|
+
uv run -p .venv ryl --version
|
|
241
|
+
|
|
242
|
+
macos:
|
|
243
|
+
needs: [version-check]
|
|
244
|
+
strategy:
|
|
245
|
+
matrix:
|
|
246
|
+
include:
|
|
247
|
+
- runner: macos-14
|
|
248
|
+
target: aarch64
|
|
249
|
+
runs-on: ${{ matrix.runner }}
|
|
250
|
+
steps:
|
|
251
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
|
252
|
+
- name: Build macOS wheels
|
|
253
|
+
uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad
|
|
254
|
+
with:
|
|
255
|
+
target: ${{ matrix.target }}
|
|
256
|
+
args: --release --out dist
|
|
257
|
+
sccache: ${{ github.event_name != 'release' }}
|
|
258
|
+
- name: Upload wheels (macOS)
|
|
259
|
+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
|
|
260
|
+
with:
|
|
261
|
+
name: wheels-macos-${{ matrix.target }}
|
|
262
|
+
path: dist
|
|
263
|
+
|
|
264
|
+
smoke-macos:
|
|
265
|
+
name: Smoke Test (macOS)
|
|
266
|
+
needs: [macos]
|
|
267
|
+
strategy:
|
|
268
|
+
matrix:
|
|
269
|
+
runner: [macos-14]
|
|
270
|
+
python: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"]
|
|
271
|
+
runs-on: ${{ matrix.runner }}
|
|
272
|
+
steps:
|
|
273
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
|
274
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
|
|
275
|
+
with:
|
|
276
|
+
pattern: wheels-macos-*
|
|
277
|
+
merge-multiple: true
|
|
278
|
+
path: dist
|
|
279
|
+
- name: Install uv
|
|
280
|
+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78
|
|
281
|
+
- name: Install wheel and run CLI
|
|
282
|
+
run: |
|
|
283
|
+
set -euxo pipefail
|
|
284
|
+
uv python install ${{ matrix.python }}
|
|
285
|
+
uv venv -p ${{ matrix.python }} .venv
|
|
286
|
+
uv pip install -p .venv --no-index --find-links dist ryl
|
|
287
|
+
uv run -p .venv ryl --version
|
|
288
|
+
|
|
289
|
+
sdist:
|
|
290
|
+
needs: [version-check]
|
|
291
|
+
runs-on: ubuntu-latest
|
|
292
|
+
steps:
|
|
293
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
|
294
|
+
- name: Build sdist
|
|
295
|
+
uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad
|
|
296
|
+
with:
|
|
297
|
+
command: sdist
|
|
298
|
+
args: --out dist
|
|
299
|
+
- name: Upload sdist
|
|
300
|
+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
|
|
301
|
+
with:
|
|
302
|
+
name: wheels-sdist
|
|
303
|
+
path: dist
|
|
304
|
+
|
|
305
|
+
upload-release-binaries:
|
|
306
|
+
name: Upload release binaries
|
|
307
|
+
needs:
|
|
308
|
+
- smoke-manylinux
|
|
309
|
+
- smoke-musllinux
|
|
310
|
+
- smoke-windows
|
|
311
|
+
- smoke-macos
|
|
312
|
+
- sdist
|
|
313
|
+
- preflight-release-guard
|
|
314
|
+
if: >-
|
|
315
|
+
startsWith(github.ref, 'refs/tags/v') &&
|
|
316
|
+
(github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.publish == true))
|
|
317
|
+
strategy:
|
|
318
|
+
fail-fast: false
|
|
319
|
+
matrix:
|
|
320
|
+
include:
|
|
321
|
+
- runner: ubuntu-22.04
|
|
322
|
+
target: x86_64-unknown-linux-gnu
|
|
323
|
+
- runner: ubuntu-22.04
|
|
324
|
+
target: aarch64-unknown-linux-gnu
|
|
325
|
+
- runner: ubuntu-22.04
|
|
326
|
+
target: armv7-unknown-linux-gnueabihf
|
|
327
|
+
- runner: ubuntu-22.04
|
|
328
|
+
target: i686-unknown-linux-gnu
|
|
329
|
+
- runner: ubuntu-22.04
|
|
330
|
+
target: powerpc64le-unknown-linux-gnu
|
|
331
|
+
- runner: ubuntu-22.04
|
|
332
|
+
target: s390x-unknown-linux-gnu
|
|
333
|
+
- runner: ubuntu-22.04
|
|
334
|
+
target: x86_64-unknown-linux-musl
|
|
335
|
+
- runner: ubuntu-22.04
|
|
336
|
+
target: aarch64-unknown-linux-musl
|
|
337
|
+
- runner: windows-latest
|
|
338
|
+
target: x86_64-pc-windows-msvc
|
|
339
|
+
- runner: windows-latest
|
|
340
|
+
target: aarch64-pc-windows-msvc
|
|
341
|
+
- runner: macos-14
|
|
342
|
+
target: aarch64-apple-darwin
|
|
343
|
+
runs-on: ${{ matrix.runner }}
|
|
344
|
+
permissions:
|
|
345
|
+
contents: read
|
|
346
|
+
steps:
|
|
347
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
|
348
|
+
- name: Build binaries for ${{ matrix.target }}
|
|
349
|
+
uses: taiki-e/upload-rust-binary-action@0e34102c043ded9f2ca39f7af5cd99a540c61aff
|
|
350
|
+
with:
|
|
351
|
+
bin: ryl
|
|
352
|
+
target: ${{ matrix.target }}
|
|
353
|
+
locked: true
|
|
354
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
355
|
+
dry-run: true
|
|
356
|
+
- name: Collect release assets for ${{ matrix.target }}
|
|
357
|
+
shell: bash
|
|
358
|
+
run: |
|
|
359
|
+
set -euo pipefail
|
|
360
|
+
shopt -s nullglob
|
|
361
|
+
mkdir -p release-assets
|
|
362
|
+
assets=(ryl-${{ matrix.target }}*)
|
|
363
|
+
for asset in "${assets[@]}"; do
|
|
364
|
+
if [ -f "$asset" ]; then
|
|
365
|
+
cp "$asset" release-assets/
|
|
366
|
+
fi
|
|
367
|
+
done
|
|
368
|
+
if [ -z "$(ls -A release-assets)" ]; then
|
|
369
|
+
echo "No release assets found for target ${{ matrix.target }}" >&2
|
|
370
|
+
exit 1
|
|
371
|
+
fi
|
|
372
|
+
- name: Upload release assets for ${{ matrix.target }}
|
|
373
|
+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
|
|
374
|
+
with:
|
|
375
|
+
name: release-binaries-${{ matrix.target }}
|
|
376
|
+
path: release-assets/*
|
|
377
|
+
|
|
378
|
+
create-github-release:
|
|
379
|
+
name: Create GitHub release
|
|
380
|
+
needs:
|
|
381
|
+
- upload-release-binaries
|
|
382
|
+
- publish-pypi
|
|
383
|
+
if: >-
|
|
384
|
+
startsWith(github.ref, 'refs/tags/v') &&
|
|
385
|
+
(github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.publish == true))
|
|
386
|
+
runs-on: ubuntu-latest
|
|
387
|
+
permissions:
|
|
388
|
+
contents: write
|
|
389
|
+
id-token: write
|
|
390
|
+
attestations: write
|
|
391
|
+
steps:
|
|
392
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
|
393
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
|
|
394
|
+
with:
|
|
395
|
+
pattern: release-binaries-*
|
|
396
|
+
merge-multiple: true
|
|
397
|
+
path: release-assets
|
|
398
|
+
- name: Generate release asset attestation
|
|
399
|
+
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32
|
|
400
|
+
with:
|
|
401
|
+
subject-path: 'release-assets/*'
|
|
402
|
+
- name: Ensure draft tag release exists
|
|
403
|
+
env:
|
|
404
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
405
|
+
RELEASE_TAG: ${{ github.ref_name }}
|
|
406
|
+
run: |
|
|
407
|
+
set -euo pipefail
|
|
408
|
+
if [[ "${GITHUB_REF}" != refs/tags/v* ]]; then
|
|
409
|
+
echo "Ref '${GITHUB_REF}' is not a release tag (refs/tags/v*)." >&2
|
|
410
|
+
exit 1
|
|
411
|
+
fi
|
|
412
|
+
release_query_err_file="$(mktemp)"
|
|
413
|
+
if release_is_draft="$(gh release view "${RELEASE_TAG}" -R "${GITHUB_REPOSITORY}" --json isDraft --jq '.isDraft' 2>"${release_query_err_file}")"; then
|
|
414
|
+
:
|
|
415
|
+
elif grep -Eq '404|not[[:space:]]+found' "${release_query_err_file}"; then
|
|
416
|
+
gh release create "${RELEASE_TAG}" -R "${GITHUB_REPOSITORY}" --verify-tag --title "${RELEASE_TAG}" --draft --generate-notes
|
|
417
|
+
exit 0
|
|
418
|
+
else
|
|
419
|
+
echo "Failed to query release ${RELEASE_TAG}." >&2
|
|
420
|
+
cat "${release_query_err_file}" >&2
|
|
421
|
+
exit 1
|
|
422
|
+
fi
|
|
423
|
+
if [ "${release_is_draft}" = "true" ]; then
|
|
424
|
+
echo "Reusing existing draft release ${RELEASE_TAG}."
|
|
425
|
+
exit 0
|
|
426
|
+
fi
|
|
427
|
+
echo "Published release ${RELEASE_TAG} already exists; refusing to continue." >&2
|
|
428
|
+
exit 1
|
|
429
|
+
- name: Upload release assets
|
|
430
|
+
env:
|
|
431
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
432
|
+
RELEASE_TAG: ${{ github.ref_name }}
|
|
433
|
+
run: gh release upload "$RELEASE_TAG" -R "${GITHUB_REPOSITORY}" release-assets/* --clobber
|
|
434
|
+
- name: Publish GitHub release
|
|
435
|
+
env:
|
|
436
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
437
|
+
RELEASE_TAG: ${{ github.ref_name }}
|
|
438
|
+
run: gh release edit "$RELEASE_TAG" -R "${GITHUB_REPOSITORY}" --draft=false
|
|
439
|
+
|
|
440
|
+
publish-crates:
|
|
441
|
+
name: Publish to crates.io
|
|
442
|
+
runs-on: ubuntu-latest
|
|
443
|
+
needs:
|
|
444
|
+
- smoke-manylinux
|
|
445
|
+
- smoke-musllinux
|
|
446
|
+
- smoke-windows
|
|
447
|
+
- smoke-macos
|
|
448
|
+
- sdist
|
|
449
|
+
- upload-release-binaries
|
|
450
|
+
if: >-
|
|
451
|
+
startsWith(github.ref, 'refs/tags/v') &&
|
|
452
|
+
(github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.publish == true))
|
|
453
|
+
permissions:
|
|
454
|
+
id-token: write
|
|
455
|
+
contents: read
|
|
456
|
+
steps:
|
|
457
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
|
458
|
+
- name: Read crate metadata
|
|
459
|
+
id: crate_metadata
|
|
460
|
+
run: |
|
|
461
|
+
set -euo pipefail
|
|
462
|
+
crate_name="$(python - <<'PY'
|
|
463
|
+
import tomllib
|
|
464
|
+
with open("Cargo.toml", "rb") as f:
|
|
465
|
+
data = tomllib.load(f)
|
|
466
|
+
print(data["package"]["name"])
|
|
467
|
+
PY
|
|
468
|
+
)"
|
|
469
|
+
crate_version="$(python - <<'PY'
|
|
470
|
+
import tomllib
|
|
471
|
+
with open("Cargo.toml", "rb") as f:
|
|
472
|
+
data = tomllib.load(f)
|
|
473
|
+
print(data["package"]["version"])
|
|
474
|
+
PY
|
|
475
|
+
)"
|
|
476
|
+
echo "name=${crate_name}" >> "${GITHUB_OUTPUT}"
|
|
477
|
+
echo "version=${crate_version}" >> "${GITHUB_OUTPUT}"
|
|
478
|
+
- name: Check if crate version already exists
|
|
479
|
+
id: crate_exists
|
|
480
|
+
env:
|
|
481
|
+
CRATE_NAME: ${{ steps.crate_metadata.outputs.name }}
|
|
482
|
+
CRATE_VERSION: ${{ steps.crate_metadata.outputs.version }}
|
|
483
|
+
HTTP_USER_AGENT: ryl-release-workflow/1.0 (+https://github.com/${{ github.repository }})
|
|
484
|
+
run: |
|
|
485
|
+
set -euo pipefail
|
|
486
|
+
url="https://crates.io/api/v1/crates/${CRATE_NAME}/${CRATE_VERSION}"
|
|
487
|
+
http_status="$(curl -sS -A "${HTTP_USER_AGENT}" -o /dev/null -w "%{http_code}" "${url}")"
|
|
488
|
+
if [ "${http_status}" = "200" ]; then
|
|
489
|
+
echo "already_published=true" >> "${GITHUB_OUTPUT}"
|
|
490
|
+
echo "Crate ${CRATE_NAME} ${CRATE_VERSION} already published; skipping cargo publish."
|
|
491
|
+
exit 0
|
|
492
|
+
fi
|
|
493
|
+
if [ "${http_status}" = "404" ]; then
|
|
494
|
+
echo "already_published=false" >> "${GITHUB_OUTPUT}"
|
|
495
|
+
exit 0
|
|
496
|
+
fi
|
|
497
|
+
echo "Unexpected crates.io response (${http_status}) for ${CRATE_NAME} ${CRATE_VERSION}." >&2
|
|
498
|
+
exit 1
|
|
499
|
+
- name: Authenticate with crates.io (Trusted Publishing)
|
|
500
|
+
if: steps.crate_exists.outputs.already_published != 'true'
|
|
501
|
+
id: crates_io_auth
|
|
502
|
+
uses: rust-lang/crates-io-auth-action@bbd81622f20ce9e2dd9622e3218b975523e45bbe
|
|
503
|
+
- name: Publish to crates.io
|
|
504
|
+
if: steps.crate_exists.outputs.already_published != 'true'
|
|
505
|
+
run: cargo publish
|
|
506
|
+
env:
|
|
507
|
+
CARGO_REGISTRY_TOKEN: ${{ steps.crates_io_auth.outputs.token }}
|
|
508
|
+
|
|
509
|
+
publish-pypi:
|
|
510
|
+
name: Publish to PyPI
|
|
511
|
+
runs-on: ubuntu-latest
|
|
512
|
+
needs:
|
|
513
|
+
- publish-crates
|
|
514
|
+
if: >-
|
|
515
|
+
startsWith(github.ref, 'refs/tags/v') &&
|
|
516
|
+
(github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.publish == true))
|
|
517
|
+
permissions:
|
|
518
|
+
id-token: write
|
|
519
|
+
contents: read
|
|
520
|
+
attestations: write
|
|
521
|
+
steps:
|
|
522
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
|
523
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
|
|
524
|
+
with:
|
|
525
|
+
pattern: wheels-*
|
|
526
|
+
merge-multiple: true
|
|
527
|
+
path: dist
|
|
528
|
+
- name: Read package metadata
|
|
529
|
+
id: package_metadata
|
|
530
|
+
run: |
|
|
531
|
+
set -euo pipefail
|
|
532
|
+
package_name="$(python - <<'PY'
|
|
533
|
+
import tomllib
|
|
534
|
+
with open("pyproject.toml", "rb") as f:
|
|
535
|
+
data = tomllib.load(f)
|
|
536
|
+
print(data["project"]["name"])
|
|
537
|
+
PY
|
|
538
|
+
)"
|
|
539
|
+
package_version="$(python - <<'PY'
|
|
540
|
+
import tomllib
|
|
541
|
+
with open("pyproject.toml", "rb") as f:
|
|
542
|
+
data = tomllib.load(f)
|
|
543
|
+
print(data["project"]["version"])
|
|
544
|
+
PY
|
|
545
|
+
)"
|
|
546
|
+
echo "name=${package_name}" >> "${GITHUB_OUTPUT}"
|
|
547
|
+
echo "version=${package_version}" >> "${GITHUB_OUTPUT}"
|
|
548
|
+
- name: Check if PyPI version already exists
|
|
549
|
+
id: pypi_exists
|
|
550
|
+
env:
|
|
551
|
+
PACKAGE_NAME: ${{ steps.package_metadata.outputs.name }}
|
|
552
|
+
PACKAGE_VERSION: ${{ steps.package_metadata.outputs.version }}
|
|
553
|
+
HTTP_USER_AGENT: ryl-release-workflow/1.0 (+https://github.com/${{ github.repository }})
|
|
554
|
+
run: |
|
|
555
|
+
set -euo pipefail
|
|
556
|
+
url="https://pypi.org/pypi/${PACKAGE_NAME}/${PACKAGE_VERSION}/json"
|
|
557
|
+
http_status="$(curl -sS -A "${HTTP_USER_AGENT}" -o /dev/null -w "%{http_code}" "${url}")"
|
|
558
|
+
if [ "${http_status}" = "200" ]; then
|
|
559
|
+
echo "already_published=true" >> "${GITHUB_OUTPUT}"
|
|
560
|
+
echo "PyPI package ${PACKAGE_NAME} ${PACKAGE_VERSION} already published; skipping upload."
|
|
561
|
+
exit 0
|
|
562
|
+
fi
|
|
563
|
+
if [ "${http_status}" = "404" ]; then
|
|
564
|
+
echo "already_published=false" >> "${GITHUB_OUTPUT}"
|
|
565
|
+
exit 0
|
|
566
|
+
fi
|
|
567
|
+
echo "Unexpected PyPI response (${http_status}) for ${PACKAGE_NAME} ${PACKAGE_VERSION}." >&2
|
|
568
|
+
exit 1
|
|
569
|
+
- name: Generate artifact attestation
|
|
570
|
+
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32
|
|
571
|
+
with:
|
|
572
|
+
subject-path: 'dist/*'
|
|
573
|
+
- name: Publish to PyPI (Trusted Publishing)
|
|
574
|
+
if: steps.pypi_exists.outputs.already_published != 'true'
|
|
575
|
+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e
|
|
576
|
+
with:
|
|
577
|
+
print-hash: true
|
|
578
|
+
skip-existing: true
|
|
579
|
+
|
|
580
|
+
notify-ryl-pre-commit:
|
|
581
|
+
name: Notify ryl-pre-commit
|
|
582
|
+
runs-on: ubuntu-latest
|
|
583
|
+
environment: automation
|
|
584
|
+
needs:
|
|
585
|
+
- create-github-release
|
|
586
|
+
- publish-pypi
|
|
587
|
+
if: >-
|
|
588
|
+
startsWith(github.ref, 'refs/tags/v') &&
|
|
589
|
+
(github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.publish == true))
|
|
590
|
+
permissions:
|
|
591
|
+
contents: read
|
|
592
|
+
steps:
|
|
593
|
+
- name: Generate token for cross-repository dispatch
|
|
594
|
+
id: app-token
|
|
595
|
+
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859
|
|
596
|
+
with:
|
|
597
|
+
app-id: ${{ secrets.AUTH_APP_CLIENT_ID }}
|
|
598
|
+
private-key: ${{ secrets.AUTH_APP_PRIVATE_KEY }}
|
|
599
|
+
owner: owenlamont
|
|
600
|
+
repositories: ryl-pre-commit
|
|
601
|
+
|
|
602
|
+
- name: Dispatch pypi_release event to ryl-pre-commit
|
|
603
|
+
env:
|
|
604
|
+
APP_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
605
|
+
RELEASE_TAG: ${{ github.ref_name }}
|
|
606
|
+
run: |
|
|
607
|
+
set -euo pipefail
|
|
608
|
+
version="${RELEASE_TAG#v}"
|
|
609
|
+
curl --fail -X POST \
|
|
610
|
+
-H "Accept: application/vnd.github+json" \
|
|
611
|
+
-H "Authorization: Bearer ${APP_TOKEN}" \
|
|
612
|
+
https://api.github.com/repos/owenlamont/ryl-pre-commit/dispatches \
|
|
613
|
+
-d "{\"event_type\":\"pypi_release\",\"client_payload\":{\"version\":\"${version}\"}}"
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
name: Update Rust Dependencies
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
schedule:
|
|
5
|
+
- cron: '30 8 * * 0' # Sunday 18:00 UTC+9:30
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
upgrade-all:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
environment: automation
|
|
12
|
+
permissions:
|
|
13
|
+
contents: write
|
|
14
|
+
pull-requests: write
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout repository
|
|
18
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
|
19
|
+
|
|
20
|
+
- name: Install cargo-edit
|
|
21
|
+
run: cargo install cargo-edit --locked
|
|
22
|
+
|
|
23
|
+
- name: Upgrade all dependencies to latest (allow majors)
|
|
24
|
+
run: |
|
|
25
|
+
cargo upgrade --incompatible --recursive
|
|
26
|
+
cargo update
|
|
27
|
+
|
|
28
|
+
- name: Check for changes
|
|
29
|
+
id: check_diff
|
|
30
|
+
run: |
|
|
31
|
+
git add -A
|
|
32
|
+
if git diff --cached --quiet; then
|
|
33
|
+
echo "changed=false" >> $GITHUB_OUTPUT
|
|
34
|
+
else
|
|
35
|
+
echo "changed=true" >> $GITHUB_OUTPUT
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
- name: Generate token
|
|
39
|
+
if: steps.check_diff.outputs.changed == 'true'
|
|
40
|
+
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859
|
|
41
|
+
id: generate-token
|
|
42
|
+
with:
|
|
43
|
+
app-id: ${{ secrets.AUTH_APP_CLIENT_ID }}
|
|
44
|
+
private-key: ${{ secrets.AUTH_APP_PRIVATE_KEY }}
|
|
45
|
+
|
|
46
|
+
- name: Create PR with upgraded dependencies
|
|
47
|
+
if: steps.check_diff.outputs.changed == 'true'
|
|
48
|
+
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0
|
|
49
|
+
with:
|
|
50
|
+
token: ${{ steps.generate-token.outputs.token }}
|
|
51
|
+
commit-message: "chore: upgrade Rust dependencies to latest (allow majors)"
|
|
52
|
+
title: "chore: upgrade Rust dependencies to latest (allow majors)"
|
|
53
|
+
body: |
|
|
54
|
+
Automated dependency refresh:
|
|
55
|
+
- Ran `cargo upgrade --incompatible --recursive`
|
|
56
|
+
- Ran `cargo update`
|
|
57
|
+
|
|
58
|
+
Merge if CI is green.
|
|
59
|
+
branch: bot/rust-deps-max
|
|
60
|
+
author: GitHub Actions <actions@github.com>
|
|
61
|
+
delete-branch: true
|