File tree 2 files changed +15
-6
lines changed
2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -15,19 +15,16 @@ jobs:
15
15
steps :
16
16
- uses : actions/checkout@v2
17
17
- name : Set up Python
18
- uses : actions/setup-python@v2
18
+ uses : actions/setup-python@v3
19
19
with :
20
20
python-version : ' 3.x'
21
21
- name : Install dependencies
22
22
run : |
23
23
python -m pip install --upgrade pip
24
24
pip install setuptools wheel twine
25
- - name : Generate library
25
+ - name : Generate and build the library
26
26
run : |
27
- bash helper.sh generate
28
- - name : Build
29
- run : |
30
- bash helper.sh build
27
+ bash helper.sh build-ci
31
28
- name : Publish to PyPI
32
29
uses : pypa/gh-action-pypi-publish@master
33
30
with :
Original file line number Diff line number Diff line change @@ -18,6 +18,13 @@ function generate {
18
18
docker run --user " $( id -u) " :" $( id -gn) " --rm -v " ${PWD} " :/local " $docker_image " generate -i " $openapi_yaml_url " -l python -o /local/" $lib " -c /local/config.json --git-user-id elabftw --git-repo-id elabapi-python
19
19
}
20
20
21
+ # don't use user/group ids in GH actions
22
+ function generate-ci {
23
+ docker run --rm -v " ${PWD} " :/local " $docker_image " generate -i " $openapi_yaml_url " -l python -o /local/" $lib " -c /local/config.json --git-user-id elabftw --git-repo-id elabapi-python
24
+ # fix permissions
25
+ chown -R " $( id -u) " :" $( id -gn) " " $lib "
26
+ }
27
+
21
28
# generate the lib from a local file in current directory
22
29
function generate-from-local {
23
30
cleanup
@@ -38,4 +45,9 @@ function publish {
38
45
cd ..
39
46
}
40
47
48
+ function build-ci {
49
+ generate-ci
50
+ build
51
+ }
52
+
41
53
" $1 "
You can’t perform that action at this time.
0 commit comments