yamloom 0.1.0__cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.whl
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.
- yamloom/__init__.py +4 -0
- yamloom/__init__.pyi +4 -0
- yamloom/__main__.py +58 -0
- yamloom/_yamloom.cpython-313t-i386-linux-gnu.so +0 -0
- yamloom/_yamloom.pyi +584 -0
- yamloom/actions/__init__.py +0 -0
- yamloom/actions/github/__init__.py +0 -0
- yamloom/actions/github/artifacts.py +237 -0
- yamloom/actions/github/cache.py +189 -0
- yamloom/actions/github/release.py +97 -0
- yamloom/actions/github/scm.py +102 -0
- yamloom/actions/packaging/__init__.py +0 -0
- yamloom/actions/packaging/python.py +84 -0
- yamloom/actions/toolchains/__init__.py +0 -0
- yamloom/actions/toolchains/dotnet.py +79 -0
- yamloom/actions/toolchains/go.py +71 -0
- yamloom/actions/toolchains/java.py +98 -0
- yamloom/actions/toolchains/node.py +138 -0
- yamloom/actions/toolchains/php.py +76 -0
- yamloom/actions/toolchains/python.py +194 -0
- yamloom/actions/toolchains/ruby.py +78 -0
- yamloom/actions/toolchains/rust.py +153 -0
- yamloom/actions/toolchains/system.py +72 -0
- yamloom/actions/types.py +30 -0
- yamloom/actions/utils.py +32 -0
- yamloom/expressions.py +5 -0
- yamloom/expressions.pyi +360 -0
- yamloom/py.typed +0 -0
- yamloom-0.1.0.dist-info/METADATA +7 -0
- yamloom-0.1.0.dist-info/RECORD +31 -0
- yamloom-0.1.0.dist-info/WHEEL +5 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from yamloom.actions.utils import validate_choice, check_string
|
|
3
|
+
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
from ..._yamloom import Step
|
|
7
|
+
from ..._yamloom import action
|
|
8
|
+
from ..types import (
|
|
9
|
+
Oboollike,
|
|
10
|
+
Oboolstr,
|
|
11
|
+
Ointlike,
|
|
12
|
+
Ostr,
|
|
13
|
+
Ostrlike,
|
|
14
|
+
StringLike,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
if TYPE_CHECKING:
|
|
18
|
+
from collections.abc import Mapping, Sequence
|
|
19
|
+
|
|
20
|
+
WARN_RETENTION_DAYS: int = 90
|
|
21
|
+
MAX_COMPRESSION_LEVEL: int = 9
|
|
22
|
+
|
|
23
|
+
__all__ = ['download_artifact', 'upload_artifact', 'upload_artifact_merge']
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def upload_artifact(
|
|
27
|
+
*,
|
|
28
|
+
path: StringLike,
|
|
29
|
+
name: Ostrlike = None,
|
|
30
|
+
version: str = 'v6',
|
|
31
|
+
artifact_name: Ostrlike = None,
|
|
32
|
+
if_no_files_found: Ostrlike = None,
|
|
33
|
+
retention_days: Ointlike = None,
|
|
34
|
+
compression_level: Ointlike = None,
|
|
35
|
+
overwrite: Oboollike = None,
|
|
36
|
+
include_hidden_files: Oboollike = None,
|
|
37
|
+
args: Ostrlike = None,
|
|
38
|
+
entrypoint: Ostrlike = None,
|
|
39
|
+
condition: Oboolstr = None,
|
|
40
|
+
working_directory: Ostrlike = None,
|
|
41
|
+
shell: Ostr = None,
|
|
42
|
+
id: Ostr = None, # noqa: A002
|
|
43
|
+
env: Mapping[str, StringLike] | None = None,
|
|
44
|
+
continue_on_error: Oboollike = None,
|
|
45
|
+
timeout_minutes: Ointlike = None,
|
|
46
|
+
) -> Step:
|
|
47
|
+
options: dict[str, object] = {
|
|
48
|
+
'path': path,
|
|
49
|
+
'name': artifact_name,
|
|
50
|
+
'if_no_files_found': validate_choice(
|
|
51
|
+
'if_no_files_found', if_no_files_found, ['warn', 'error', 'ignore']
|
|
52
|
+
),
|
|
53
|
+
'retention-days': retention_days,
|
|
54
|
+
'compression-level': compression_level,
|
|
55
|
+
'overwrite': overwrite,
|
|
56
|
+
'include-hidden-files': include_hidden_files,
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if retention_days is not None:
|
|
60
|
+
if isinstance(retention_days, int) and not isinstance(retention_days, bool):
|
|
61
|
+
if retention_days < 1:
|
|
62
|
+
msg = 'retention days must be > 0'
|
|
63
|
+
raise ValueError(msg)
|
|
64
|
+
if retention_days > WARN_RETENTION_DAYS:
|
|
65
|
+
print(
|
|
66
|
+
f'Warning: retention days should be <= {WARN_RETENTION_DAYS} unless a higher limit is made in the repository settings!'
|
|
67
|
+
)
|
|
68
|
+
options['retention-days'] = retention_days
|
|
69
|
+
|
|
70
|
+
if compression_level is not None:
|
|
71
|
+
if (
|
|
72
|
+
isinstance(compression_level, int)
|
|
73
|
+
and not isinstance(compression_level, bool)
|
|
74
|
+
) and (compression_level < 0 or compression_level > MAX_COMPRESSION_LEVEL):
|
|
75
|
+
msg = f'compression level must be in the range 0-{MAX_COMPRESSION_LEVEL}'
|
|
76
|
+
raise ValueError(msg)
|
|
77
|
+
options['compression-level'] = compression_level
|
|
78
|
+
|
|
79
|
+
options = {key: value for key, value in options.items() if value is not None}
|
|
80
|
+
|
|
81
|
+
if name is None:
|
|
82
|
+
artifact_str = check_string(options.get('artifact_name'))
|
|
83
|
+
if artifact_str:
|
|
84
|
+
name = f'Upload {artifact_str}'
|
|
85
|
+
else:
|
|
86
|
+
name = 'Upload Artifact'
|
|
87
|
+
|
|
88
|
+
return action(
|
|
89
|
+
name,
|
|
90
|
+
'actions/upload-artifact',
|
|
91
|
+
ref=version,
|
|
92
|
+
with_opts=options or None,
|
|
93
|
+
args=args,
|
|
94
|
+
entrypoint=entrypoint,
|
|
95
|
+
condition=condition,
|
|
96
|
+
working_directory=working_directory,
|
|
97
|
+
shell=shell,
|
|
98
|
+
id=id,
|
|
99
|
+
env=env,
|
|
100
|
+
continue_on_error=continue_on_error,
|
|
101
|
+
timeout_minutes=timeout_minutes,
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def upload_artifact_merge(
|
|
106
|
+
*,
|
|
107
|
+
pattern: Ostrlike = None,
|
|
108
|
+
name: Ostrlike = None,
|
|
109
|
+
version: str = 'v6',
|
|
110
|
+
artifact_name: Ostrlike = None,
|
|
111
|
+
separate_directories: Oboollike = None,
|
|
112
|
+
delete_merged: Oboollike = None,
|
|
113
|
+
retention_days: Ointlike = None,
|
|
114
|
+
compression_level: Ointlike = None,
|
|
115
|
+
args: Ostrlike = None,
|
|
116
|
+
entrypoint: Ostrlike = None,
|
|
117
|
+
condition: Oboolstr = None,
|
|
118
|
+
working_directory: Ostrlike = None,
|
|
119
|
+
shell: Ostr = None,
|
|
120
|
+
id: Ostr = None, # noqa: A002
|
|
121
|
+
env: Mapping[str, StringLike] | None = None,
|
|
122
|
+
continue_on_error: Oboollike = None,
|
|
123
|
+
timeout_minutes: Ointlike = None,
|
|
124
|
+
) -> Step:
|
|
125
|
+
options: dict[str, object] = {
|
|
126
|
+
'name': artifact_name,
|
|
127
|
+
'pattern': pattern,
|
|
128
|
+
'separate-directories': separate_directories,
|
|
129
|
+
'delete-merged': delete_merged,
|
|
130
|
+
'retention-days': retention_days,
|
|
131
|
+
'compression-level': compression_level,
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if retention_days is not None:
|
|
135
|
+
if isinstance(retention_days, int) and not isinstance(retention_days, bool):
|
|
136
|
+
if retention_days < 1:
|
|
137
|
+
msg = 'retention days must be > 0'
|
|
138
|
+
raise ValueError(msg)
|
|
139
|
+
if retention_days > WARN_RETENTION_DAYS:
|
|
140
|
+
print(
|
|
141
|
+
f'Warning: retention days should be <= {WARN_RETENTION_DAYS} unless a higher limit is made in the repository settings!'
|
|
142
|
+
)
|
|
143
|
+
options['retention-days'] = retention_days
|
|
144
|
+
|
|
145
|
+
if compression_level is not None:
|
|
146
|
+
if (
|
|
147
|
+
isinstance(compression_level, int)
|
|
148
|
+
and not isinstance(compression_level, bool)
|
|
149
|
+
) and (compression_level < 0 or compression_level > MAX_COMPRESSION_LEVEL):
|
|
150
|
+
msg = f'compression level must be in the range 0-{MAX_COMPRESSION_LEVEL}'
|
|
151
|
+
raise ValueError(msg)
|
|
152
|
+
options['compression-level'] = compression_level
|
|
153
|
+
|
|
154
|
+
options = {key: value for key, value in options.items() if value is not None}
|
|
155
|
+
|
|
156
|
+
if name is None:
|
|
157
|
+
artifact_str = check_string(options.get('artifact_name'))
|
|
158
|
+
if artifact_str:
|
|
159
|
+
name = f'Upload (merged) {artifact_str}'
|
|
160
|
+
else:
|
|
161
|
+
name = 'Upload (merged) Artifact'
|
|
162
|
+
|
|
163
|
+
return action(
|
|
164
|
+
name,
|
|
165
|
+
'actions/upload-artifact/merge',
|
|
166
|
+
ref=version,
|
|
167
|
+
with_opts=options or None,
|
|
168
|
+
args=args,
|
|
169
|
+
entrypoint=entrypoint,
|
|
170
|
+
condition=condition,
|
|
171
|
+
working_directory=working_directory,
|
|
172
|
+
shell=shell,
|
|
173
|
+
id=id,
|
|
174
|
+
env=env,
|
|
175
|
+
continue_on_error=continue_on_error,
|
|
176
|
+
timeout_minutes=timeout_minutes,
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
def download_artifact(
|
|
181
|
+
*,
|
|
182
|
+
path: Ostrlike = None,
|
|
183
|
+
name: Ostrlike = None,
|
|
184
|
+
version: str = 'v7',
|
|
185
|
+
artifact_name: Ostrlike = None,
|
|
186
|
+
artifact_ids: Sequence[StringLike] | None = None,
|
|
187
|
+
pattern: Ostrlike = None,
|
|
188
|
+
merge_multiple: Oboollike = None,
|
|
189
|
+
github_token: Ostrlike = None,
|
|
190
|
+
repository: Ostrlike = None,
|
|
191
|
+
run_id: Ostrlike = None,
|
|
192
|
+
args: Ostrlike = None,
|
|
193
|
+
entrypoint: Ostrlike = None,
|
|
194
|
+
condition: Oboolstr = None,
|
|
195
|
+
working_directory: Ostrlike = None,
|
|
196
|
+
shell: Ostr = None,
|
|
197
|
+
id: Ostr = None, # noqa: A002
|
|
198
|
+
env: Mapping[str, StringLike] | None = None,
|
|
199
|
+
continue_on_error: Oboollike = None,
|
|
200
|
+
timeout_minutes: Ointlike = None,
|
|
201
|
+
) -> Step:
|
|
202
|
+
options: dict[str, object] = {
|
|
203
|
+
'name': artifact_name,
|
|
204
|
+
'artifact-ids': ','.join(str(s) for s in artifact_ids)
|
|
205
|
+
if artifact_ids is not None
|
|
206
|
+
else None,
|
|
207
|
+
'pattern': pattern,
|
|
208
|
+
'path': path,
|
|
209
|
+
'merge-multiple': merge_multiple,
|
|
210
|
+
'github-token': github_token,
|
|
211
|
+
'repository': repository,
|
|
212
|
+
'run-id': run_id,
|
|
213
|
+
}
|
|
214
|
+
options = {key: value for key, value in options.items() if value is not None}
|
|
215
|
+
|
|
216
|
+
if name is None:
|
|
217
|
+
artifact_str = check_string(options.get('artifact_name'))
|
|
218
|
+
if artifact_str:
|
|
219
|
+
name = f'Download {artifact_str}'
|
|
220
|
+
else:
|
|
221
|
+
name = 'Download Artifact'
|
|
222
|
+
|
|
223
|
+
return action(
|
|
224
|
+
name,
|
|
225
|
+
'actions/download-artifact',
|
|
226
|
+
ref=version,
|
|
227
|
+
with_opts=options or None,
|
|
228
|
+
args=args,
|
|
229
|
+
entrypoint=entrypoint,
|
|
230
|
+
condition=condition,
|
|
231
|
+
working_directory=working_directory,
|
|
232
|
+
shell=shell,
|
|
233
|
+
id=id,
|
|
234
|
+
env=env,
|
|
235
|
+
continue_on_error=continue_on_error,
|
|
236
|
+
timeout_minutes=timeout_minutes,
|
|
237
|
+
)
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
from ..._yamloom import Step
|
|
6
|
+
from ..._yamloom import action
|
|
7
|
+
from ..types import (
|
|
8
|
+
Obool,
|
|
9
|
+
Oboollike,
|
|
10
|
+
Oboolstr,
|
|
11
|
+
Oint,
|
|
12
|
+
Ointlike,
|
|
13
|
+
Ostr,
|
|
14
|
+
Ostrlike,
|
|
15
|
+
StringLike,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
if TYPE_CHECKING:
|
|
19
|
+
from collections.abc import Mapping, Sequence
|
|
20
|
+
|
|
21
|
+
__all__ = ['cache', 'cache_restore', 'cache_save']
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def cache(
|
|
25
|
+
*,
|
|
26
|
+
key: str,
|
|
27
|
+
name: Ostrlike = None,
|
|
28
|
+
version: str = 'v5',
|
|
29
|
+
path: Sequence[str] | None = None,
|
|
30
|
+
restore_keys: Sequence[str] | None = None,
|
|
31
|
+
enable_cross_os_archive: Obool = None,
|
|
32
|
+
fail_on_cache_miss: Obool = None,
|
|
33
|
+
lookup_only: Obool = None,
|
|
34
|
+
segment_download_timeout_mins: Oint = None,
|
|
35
|
+
args: Ostrlike = None,
|
|
36
|
+
entrypoint: Ostrlike = None,
|
|
37
|
+
condition: Oboolstr = None,
|
|
38
|
+
working_directory: Ostrlike = None,
|
|
39
|
+
shell: Ostr = None,
|
|
40
|
+
id: Ostr = None, # noqa: A002
|
|
41
|
+
env: Mapping[str, StringLike] | None = None,
|
|
42
|
+
continue_on_error: Oboollike = None,
|
|
43
|
+
timeout_minutes: Ointlike = None,
|
|
44
|
+
) -> Step:
|
|
45
|
+
options: dict[str, object] = {
|
|
46
|
+
'key': key,
|
|
47
|
+
'path': list(path) if path is not None else None,
|
|
48
|
+
'restore-keys': list(restore_keys) if restore_keys is not None else None,
|
|
49
|
+
'ensembleCrossOsArchive': enable_cross_os_archive,
|
|
50
|
+
'fail-on-cache-miss': fail_on_cache_miss,
|
|
51
|
+
'lookup-only': lookup_only,
|
|
52
|
+
}
|
|
53
|
+
options = {key: value for key, value in options.items() if value is not None}
|
|
54
|
+
|
|
55
|
+
if name is None:
|
|
56
|
+
name = 'Save/Restore Cache'
|
|
57
|
+
|
|
58
|
+
if segment_download_timeout_mins is not None:
|
|
59
|
+
merged_env = dict(env or {})
|
|
60
|
+
merged_env['SEGMENT_DOWNLOAD_TIMEOUT_MINS'] = str(segment_download_timeout_mins)
|
|
61
|
+
env = merged_env
|
|
62
|
+
|
|
63
|
+
return action(
|
|
64
|
+
name,
|
|
65
|
+
'actions/cache',
|
|
66
|
+
ref=version,
|
|
67
|
+
with_opts=options or None,
|
|
68
|
+
args=args,
|
|
69
|
+
entrypoint=entrypoint,
|
|
70
|
+
condition=condition,
|
|
71
|
+
working_directory=working_directory,
|
|
72
|
+
shell=shell,
|
|
73
|
+
id=id,
|
|
74
|
+
env=env,
|
|
75
|
+
continue_on_error=continue_on_error,
|
|
76
|
+
timeout_minutes=timeout_minutes,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def cache_save(
|
|
81
|
+
*,
|
|
82
|
+
key: str,
|
|
83
|
+
name: Ostrlike = None,
|
|
84
|
+
version: str = 'v5',
|
|
85
|
+
path: Sequence[str] | None = None,
|
|
86
|
+
restore_keys: Sequence[str] | None = None,
|
|
87
|
+
enable_cross_os_archive: Obool = None,
|
|
88
|
+
fail_on_cache_miss: Obool = None,
|
|
89
|
+
lookup_only: Obool = None,
|
|
90
|
+
segment_download_timeout_mins: Oint = None,
|
|
91
|
+
args: Ostrlike = None,
|
|
92
|
+
entrypoint: Ostrlike = None,
|
|
93
|
+
condition: Oboolstr = None,
|
|
94
|
+
working_directory: Ostrlike = None,
|
|
95
|
+
shell: Ostr = None,
|
|
96
|
+
id: Ostr = None, # noqa: A002
|
|
97
|
+
env: Mapping[str, StringLike] | None = None,
|
|
98
|
+
continue_on_error: Oboollike = None,
|
|
99
|
+
timeout_minutes: Ointlike = None,
|
|
100
|
+
) -> Step:
|
|
101
|
+
options: dict[str, object] = {
|
|
102
|
+
'key': key,
|
|
103
|
+
'path': list(path) if path is not None else None,
|
|
104
|
+
'restore-keys': list(restore_keys) if restore_keys is not None else None,
|
|
105
|
+
'ensembleCrossOsArchive': enable_cross_os_archive,
|
|
106
|
+
'fail-on-cache-miss': fail_on_cache_miss,
|
|
107
|
+
'lookup-only': lookup_only,
|
|
108
|
+
}
|
|
109
|
+
options = {key: value for key, value in options.items() if value is not None}
|
|
110
|
+
|
|
111
|
+
if name is None:
|
|
112
|
+
name = 'Save Cache'
|
|
113
|
+
|
|
114
|
+
if segment_download_timeout_mins is not None:
|
|
115
|
+
merged_env = dict(env or {})
|
|
116
|
+
merged_env['SEGMENT_DOWNLOAD_TIMEOUT_MINS'] = str(segment_download_timeout_mins)
|
|
117
|
+
env = merged_env
|
|
118
|
+
|
|
119
|
+
return action(
|
|
120
|
+
name,
|
|
121
|
+
'actions/cache/save',
|
|
122
|
+
ref=version,
|
|
123
|
+
with_opts=options or None,
|
|
124
|
+
args=args,
|
|
125
|
+
entrypoint=entrypoint,
|
|
126
|
+
condition=condition,
|
|
127
|
+
working_directory=working_directory,
|
|
128
|
+
shell=shell,
|
|
129
|
+
id=id,
|
|
130
|
+
env=env,
|
|
131
|
+
continue_on_error=continue_on_error,
|
|
132
|
+
timeout_minutes=timeout_minutes,
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def cache_restore(
|
|
137
|
+
*,
|
|
138
|
+
key: StringLike,
|
|
139
|
+
name: Ostrlike = None,
|
|
140
|
+
version: str = 'v5',
|
|
141
|
+
path: Sequence[StringLike] | None = None,
|
|
142
|
+
restore_keys: Sequence[StringLike] | None = None,
|
|
143
|
+
enable_cross_os_archive: Oboollike = None,
|
|
144
|
+
fail_on_cache_miss: Oboollike = None,
|
|
145
|
+
lookup_only: Oboollike = None,
|
|
146
|
+
segment_download_timeout_mins: Ointlike = None,
|
|
147
|
+
args: Ostrlike = None,
|
|
148
|
+
entrypoint: Ostrlike = None,
|
|
149
|
+
condition: Oboolstr = None,
|
|
150
|
+
working_directory: Ostrlike = None,
|
|
151
|
+
shell: Ostr = None,
|
|
152
|
+
id: Ostr = None, # noqa: A002
|
|
153
|
+
env: Mapping[str, StringLike] | None = None,
|
|
154
|
+
continue_on_error: Oboollike = None,
|
|
155
|
+
timeout_minutes: Ointlike = None,
|
|
156
|
+
) -> Step:
|
|
157
|
+
options: dict[str, object] = {
|
|
158
|
+
'key': key,
|
|
159
|
+
'path': list(path) if path is not None else None,
|
|
160
|
+
'restore-keys': list(restore_keys) if restore_keys is not None else None,
|
|
161
|
+
'ensembleCrossOsArchive': enable_cross_os_archive,
|
|
162
|
+
'fail-on-cache-miss': fail_on_cache_miss,
|
|
163
|
+
'lookup-only': lookup_only,
|
|
164
|
+
}
|
|
165
|
+
options = {key: value for key, value in options.items() if value is not None}
|
|
166
|
+
|
|
167
|
+
if name is None:
|
|
168
|
+
name = 'Restore Cache'
|
|
169
|
+
|
|
170
|
+
if segment_download_timeout_mins is not None:
|
|
171
|
+
merged_env = dict(env or {})
|
|
172
|
+
merged_env['SEGMENT_DOWNLOAD_TIMEOUT_MINS'] = str(segment_download_timeout_mins)
|
|
173
|
+
env = merged_env
|
|
174
|
+
|
|
175
|
+
return action(
|
|
176
|
+
name,
|
|
177
|
+
'actions/cache/restore',
|
|
178
|
+
ref=version,
|
|
179
|
+
with_opts=options or None,
|
|
180
|
+
args=args,
|
|
181
|
+
entrypoint=entrypoint,
|
|
182
|
+
condition=condition,
|
|
183
|
+
working_directory=working_directory,
|
|
184
|
+
shell=shell,
|
|
185
|
+
id=id,
|
|
186
|
+
env=env,
|
|
187
|
+
continue_on_error=continue_on_error,
|
|
188
|
+
timeout_minutes=timeout_minutes,
|
|
189
|
+
)
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from yamloom.actions.utils import check_string
|
|
3
|
+
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
from ..._yamloom import Step
|
|
7
|
+
from ..._yamloom import action
|
|
8
|
+
from ..types import (
|
|
9
|
+
Obool,
|
|
10
|
+
Oboollike,
|
|
11
|
+
Oboolstr,
|
|
12
|
+
Ointlike,
|
|
13
|
+
Ostr,
|
|
14
|
+
Ostrlike,
|
|
15
|
+
StringLike,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
if TYPE_CHECKING:
|
|
19
|
+
from collections.abc import Mapping
|
|
20
|
+
|
|
21
|
+
__all__ = ['release']
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def release(
|
|
25
|
+
*,
|
|
26
|
+
name: Ostrlike = None,
|
|
27
|
+
version: str = 'v2',
|
|
28
|
+
body: Ostr = None,
|
|
29
|
+
body_path: Ostr = None,
|
|
30
|
+
draft: Obool = None,
|
|
31
|
+
prerelease: Obool = None,
|
|
32
|
+
preserve_order: Obool = None,
|
|
33
|
+
files: Ostr = None,
|
|
34
|
+
overwrite_files: Obool = None,
|
|
35
|
+
release_name: Ostr = None,
|
|
36
|
+
tag_name: Ostr = None,
|
|
37
|
+
fail_on_unmatched_files: Obool = None,
|
|
38
|
+
repository: Ostr = None,
|
|
39
|
+
target_commitish: Ostr = None,
|
|
40
|
+
token: Ostr = None,
|
|
41
|
+
discussion_category_name: Ostr = None,
|
|
42
|
+
generate_release_notes: Obool = None,
|
|
43
|
+
append_body: Obool = None,
|
|
44
|
+
make_latest: Ostr = None,
|
|
45
|
+
args: Ostrlike = None,
|
|
46
|
+
entrypoint: Ostrlike = None,
|
|
47
|
+
condition: Oboolstr = None,
|
|
48
|
+
working_directory: Ostrlike = None,
|
|
49
|
+
shell: Ostr = None,
|
|
50
|
+
id: Ostr = None, # noqa: A002
|
|
51
|
+
env: Mapping[str, StringLike] | None = None,
|
|
52
|
+
continue_on_error: Oboollike = None,
|
|
53
|
+
timeout_minutes: Ointlike = None,
|
|
54
|
+
) -> Step:
|
|
55
|
+
options: dict[str, object] = {
|
|
56
|
+
'body': body,
|
|
57
|
+
'body_path': body_path,
|
|
58
|
+
'draft': draft,
|
|
59
|
+
'prerelease': prerelease,
|
|
60
|
+
'preserve_order': preserve_order,
|
|
61
|
+
'files': files,
|
|
62
|
+
'overwrite_files': overwrite_files,
|
|
63
|
+
'name': release_name,
|
|
64
|
+
'tag_name': tag_name,
|
|
65
|
+
'fail_on_unmatched_files': fail_on_unmatched_files,
|
|
66
|
+
'repository': repository,
|
|
67
|
+
'target_commitish': target_commitish,
|
|
68
|
+
'token': token,
|
|
69
|
+
'discussion_category_name': discussion_category_name,
|
|
70
|
+
'generate_release_notes': generate_release_notes,
|
|
71
|
+
'append_body': append_body,
|
|
72
|
+
'make_latest': make_latest,
|
|
73
|
+
}
|
|
74
|
+
options = {key: value for key, value in options.items() if value is not None}
|
|
75
|
+
|
|
76
|
+
if name is None:
|
|
77
|
+
repository_str = check_string(options.get('repository'))
|
|
78
|
+
if repository_str:
|
|
79
|
+
name = f"Make Release for '{repository_str}'"
|
|
80
|
+
else:
|
|
81
|
+
name = 'Make Release'
|
|
82
|
+
|
|
83
|
+
return action(
|
|
84
|
+
name,
|
|
85
|
+
'softprops/action-gh-release',
|
|
86
|
+
ref=version,
|
|
87
|
+
with_opts=options or None,
|
|
88
|
+
args=args,
|
|
89
|
+
entrypoint=entrypoint,
|
|
90
|
+
condition=condition,
|
|
91
|
+
working_directory=working_directory,
|
|
92
|
+
shell=shell,
|
|
93
|
+
id=id,
|
|
94
|
+
env=env,
|
|
95
|
+
continue_on_error=continue_on_error,
|
|
96
|
+
timeout_minutes=timeout_minutes,
|
|
97
|
+
)
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from yamloom.actions.utils import check_string
|
|
3
|
+
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
from ..._yamloom import Step
|
|
7
|
+
from ..._yamloom import action
|
|
8
|
+
from ..types import (
|
|
9
|
+
Oboollike,
|
|
10
|
+
Oboolstr,
|
|
11
|
+
Ointlike,
|
|
12
|
+
Ostr,
|
|
13
|
+
Ostrlike,
|
|
14
|
+
StringLike,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
if TYPE_CHECKING:
|
|
18
|
+
from collections.abc import Mapping
|
|
19
|
+
|
|
20
|
+
__all__ = ['checkout']
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def checkout(
|
|
24
|
+
*,
|
|
25
|
+
name: Ostrlike = None,
|
|
26
|
+
version: str = 'v6',
|
|
27
|
+
repository: Ostrlike = None,
|
|
28
|
+
ref: Ostrlike = None,
|
|
29
|
+
token: Ostrlike = None,
|
|
30
|
+
ssh_key: Ostrlike = None,
|
|
31
|
+
ssh_known_hosts: Ostrlike = None,
|
|
32
|
+
ssh_strict: Oboollike = None,
|
|
33
|
+
ssh_user: Ostrlike = None,
|
|
34
|
+
persist_credentials: Oboollike = None,
|
|
35
|
+
path: Ostrlike = None,
|
|
36
|
+
clean: Oboollike = None,
|
|
37
|
+
filter: Ostrlike = None, # noqa: A002
|
|
38
|
+
sparse_checkout: Ostrlike = None,
|
|
39
|
+
sparse_checkout_cone_mode: Oboollike = None,
|
|
40
|
+
fetch_depth: Ointlike = None,
|
|
41
|
+
fetch_tags: Oboollike = None,
|
|
42
|
+
show_progress: Oboollike = None,
|
|
43
|
+
lfs: Oboollike = None,
|
|
44
|
+
submodules: Oboollike = None,
|
|
45
|
+
get_safe_directory: Oboollike = None,
|
|
46
|
+
github_server_url: Ostrlike = None,
|
|
47
|
+
args: Ostrlike = None,
|
|
48
|
+
entrypoint: Ostrlike = None,
|
|
49
|
+
condition: Oboolstr = None,
|
|
50
|
+
working_directory: Ostrlike = None,
|
|
51
|
+
shell: Ostr = None,
|
|
52
|
+
id: Ostr = None, # noqa: A002
|
|
53
|
+
env: Mapping[str, StringLike] | None = None,
|
|
54
|
+
continue_on_error: Oboollike = None,
|
|
55
|
+
timeout_minutes: Ointlike = None,
|
|
56
|
+
) -> Step:
|
|
57
|
+
options: dict[str, object] = {
|
|
58
|
+
'repository': repository,
|
|
59
|
+
'ref': ref,
|
|
60
|
+
'token': token,
|
|
61
|
+
'ssh-key': ssh_key,
|
|
62
|
+
'ssh-known-hosts': ssh_known_hosts,
|
|
63
|
+
'ssh-strict': ssh_strict,
|
|
64
|
+
'ssh-user': ssh_user,
|
|
65
|
+
'persist-credentials': persist_credentials,
|
|
66
|
+
'path': path,
|
|
67
|
+
'clean': clean,
|
|
68
|
+
'filter': filter,
|
|
69
|
+
'sparse-checkout': sparse_checkout,
|
|
70
|
+
'sparse-checkout-cone-mode': sparse_checkout_cone_mode,
|
|
71
|
+
'fetch-depth': fetch_depth,
|
|
72
|
+
'fetch-tags': fetch_tags,
|
|
73
|
+
'show-progress': show_progress,
|
|
74
|
+
'lfs': lfs,
|
|
75
|
+
'submodules': submodules,
|
|
76
|
+
'get-safe-directory': get_safe_directory,
|
|
77
|
+
'github-server-url': github_server_url,
|
|
78
|
+
}
|
|
79
|
+
options = {key: value for key, value in options.items() if value is not None}
|
|
80
|
+
|
|
81
|
+
if name is None:
|
|
82
|
+
repository_str = check_string(options.get('repository'))
|
|
83
|
+
if repository_str:
|
|
84
|
+
name = f"Checkout '{repository_str}'"
|
|
85
|
+
else:
|
|
86
|
+
name = 'Checkout Repository'
|
|
87
|
+
|
|
88
|
+
return action(
|
|
89
|
+
name,
|
|
90
|
+
'actions/checkout',
|
|
91
|
+
ref=version,
|
|
92
|
+
with_opts=options or None,
|
|
93
|
+
args=args,
|
|
94
|
+
entrypoint=entrypoint,
|
|
95
|
+
condition=condition,
|
|
96
|
+
working_directory=working_directory,
|
|
97
|
+
shell=shell,
|
|
98
|
+
id=id,
|
|
99
|
+
env=env,
|
|
100
|
+
continue_on_error=continue_on_error,
|
|
101
|
+
timeout_minutes=timeout_minutes,
|
|
102
|
+
)
|
|
File without changes
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
from ..._yamloom import Step
|
|
6
|
+
from ..._yamloom import action
|
|
7
|
+
from ..types import (
|
|
8
|
+
Oboollike,
|
|
9
|
+
Oboolstr,
|
|
10
|
+
Ointlike,
|
|
11
|
+
Ostr,
|
|
12
|
+
Ostrlike,
|
|
13
|
+
StringLike,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
if TYPE_CHECKING:
|
|
17
|
+
from collections.abc import Mapping, Sequence
|
|
18
|
+
|
|
19
|
+
__all__ = ['maturin']
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def maturin(
|
|
23
|
+
*,
|
|
24
|
+
name: Ostrlike = None,
|
|
25
|
+
version: str = 'v1',
|
|
26
|
+
token: Ostrlike = None,
|
|
27
|
+
command: Ostrlike = None,
|
|
28
|
+
maturin_version: Ostrlike = None,
|
|
29
|
+
manylinux: Ostrlike = None,
|
|
30
|
+
container: Ostrlike = None,
|
|
31
|
+
docker_options: Ostrlike = None,
|
|
32
|
+
host_home_mount: Ostrlike = None,
|
|
33
|
+
target: Ostrlike = None,
|
|
34
|
+
rust_toolchain: Ostrlike = None,
|
|
35
|
+
rustup_components: Sequence[StringLike] | None = None,
|
|
36
|
+
maturin_working_directory: Ostrlike = None,
|
|
37
|
+
sccache: Oboollike = None,
|
|
38
|
+
before_script_linux: Ostrlike = None,
|
|
39
|
+
args: Ostrlike = None,
|
|
40
|
+
entrypoint: Ostrlike = None,
|
|
41
|
+
condition: Oboolstr = None,
|
|
42
|
+
working_directory: Ostrlike = None,
|
|
43
|
+
shell: Ostr = None,
|
|
44
|
+
id: Ostr = None, # noqa: A002
|
|
45
|
+
env: Mapping[str, StringLike] | None = None,
|
|
46
|
+
continue_on_error: Oboollike = None,
|
|
47
|
+
timeout_minutes: Ointlike = None,
|
|
48
|
+
) -> Step:
|
|
49
|
+
options: dict[str, object] = {
|
|
50
|
+
'command': command,
|
|
51
|
+
'maturin-version': maturin_version,
|
|
52
|
+
'manylinux': manylinux,
|
|
53
|
+
'target': target,
|
|
54
|
+
'container': container,
|
|
55
|
+
'docker-options': docker_options,
|
|
56
|
+
'rust-toolchain': rust_toolchain,
|
|
57
|
+
'rustup-components': ','.join(str(s) for s in rustup_components)
|
|
58
|
+
if rustup_components is not None
|
|
59
|
+
else None,
|
|
60
|
+
'working-directory': maturin_working_directory,
|
|
61
|
+
'sccache': sccache,
|
|
62
|
+
'before-script-linux': before_script_linux,
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
options = {key: value for key, value in options.items() if value is not None}
|
|
66
|
+
|
|
67
|
+
if name is None:
|
|
68
|
+
name = 'Maturin Action'
|
|
69
|
+
|
|
70
|
+
return action(
|
|
71
|
+
name,
|
|
72
|
+
'PyO3/maturin-action',
|
|
73
|
+
ref=version,
|
|
74
|
+
with_opts=options or None,
|
|
75
|
+
args=args,
|
|
76
|
+
entrypoint=entrypoint,
|
|
77
|
+
condition=condition,
|
|
78
|
+
working_directory=working_directory,
|
|
79
|
+
shell=shell,
|
|
80
|
+
id=id,
|
|
81
|
+
env=env,
|
|
82
|
+
continue_on_error=continue_on_error,
|
|
83
|
+
timeout_minutes=timeout_minutes,
|
|
84
|
+
)
|