Skip to content

Commit b0ef756

Browse files
committed
try and fix gh action
1 parent 85af0e1 commit b0ef756

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

Diff for: .github/workflows/publish.yml

+3-6
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,16 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v2
1717
- name: Set up Python
18-
uses: actions/setup-python@v2
18+
uses: actions/setup-python@v3
1919
with:
2020
python-version: '3.x'
2121
- name: Install dependencies
2222
run: |
2323
python -m pip install --upgrade pip
2424
pip install setuptools wheel twine
25-
- name: Generate library
25+
- name: Generate and build the library
2626
run: |
27-
bash helper.sh generate
28-
- name: Build
29-
run: |
30-
bash helper.sh build
27+
bash helper.sh build-ci
3128
- name: Publish to PyPI
3229
uses: pypa/gh-action-pypi-publish@master
3330
with:

Diff for: helper.sh

+12
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ function generate {
1818
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
1919
}
2020

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+
2128
# generate the lib from a local file in current directory
2229
function generate-from-local {
2330
cleanup
@@ -38,4 +45,9 @@ function publish {
3845
cd ..
3946
}
4047

48+
function build-ci {
49+
generate-ci
50+
build
51+
}
52+
4153
"$1"

0 commit comments

Comments
 (0)