@@ -16,43 +16,92 @@ jobs:
1616 release :
1717 runs-on : ubuntu-22.04
1818 steps :
19- - name : Download compiled files
19+ - uses : actions/checkout@v4
20+
21+ - name : Download artifacts
2022 uses : actions/download-artifact@v4
2123 with :
2224 run-id : ${{ inputs.last_build_id }}
23- path : compiled /
25+ path : artifacts /
2426 # A token with actions:read permissions to download artifacts from another workflow run.
2527 github-token : ${{ secrets.GITHUB_TOKEN }}
2628
27- - name : List compiled files
29+ - name : List artifacts
30+ run : |
31+ tree -sh artifacts/
32+
33+ - name : Set up Python3.8
34+ uses : actions/setup-python@v4
35+ with :
36+ python-version : 3.8
37+
38+ - name : Install dependencies
2839 run : |
29- tree -sh compiled/
40+ python -m pip install setuptools wheel twine
3041
3142 - name : Make wheels
3243 run : |
33- ...todo
44+ for artifact_name in `ls artifacts/`
45+ do
46+ cd ${{ github.workspace }}
47+ git reset --hard
48+ git clean -dfx build pyexiv2 pyexiv2.egg-info
49+ rm -rf pyexiv2/tests/
50+
51+ echo "- Processing ${artifact_name}"
52+ mv artifacts/${artifact_name}/* pyexiv2/lib/
53+
54+ fields=(${artifact_name//-/ })
55+ py_version=`echo ${fields[0]} | sed 's#\.##g' | sed 's#py##g'`
56+ exiv2_platform_name=${fields[1]}-${fields[2]}
57+
58+ # ${exiv2_platform_name} depends on the runner.os in https://github.com/Exiv2/exiv2/blob/main/.github/workflows/release.yml
59+ # ${plat_name} depends on the platform tag in https://packaging.python.org/en/latest/specifications/platform-compatibility-tags
60+ if [ ${exiv2_platform_name} == Linux-x86_64 ]
61+ then
62+ plat_name=manylinux2014_x86_64
63+ elif [ ${exiv2_platform_name} == Linux-aarch64 ]
64+ then
65+ plat_name=manylinux2014_aarch64
66+ elif [ ${exiv2_platform_name} == Darwin-x86_64 ]
67+ then
68+ plat_name=macosx_13_0_x86_64
69+ elif [ ${exiv2_platform_name} == Darwin-arm64 ]
70+ then
71+ plat_name=macosx_14_0_arm64
72+ elif [ ${exiv2_platform_name} == 2022msvc-AMD64 ]
73+ then
74+ plat_name=win_amd64
75+ else
76+ echo "Unknown platform: ${item}"
77+ exit 1
78+ fi
79+
80+ echo " - python setup.py bdist_wheel --python-tag cp${py_version} --plat-name ${plat_name}"
81+ python setup.py bdist_wheel --python-tag cp${py_version} --plat-name ${plat_name}
82+ done
3483
3584 - name : Upload wheels as artifacts
3685 uses : actions/upload-artifact@v4
3786 with :
3887 name : wheels
3988 path : |
40- dist/
89+ dist/*
4190 if-no-files-found : error
4291 retention-days : 3
4392
44- - name : Upload to GitHub
93+ - name : Upload wheels to GitHub
4594 uses : softprops/action-gh-release@v2
46- if : inputs.upload_to_github == true
95+ if : inputs.upload_to_github == ' true'
4796 with :
4897 name : A draft for release
4998 draft : true
5099 body : This release is automatically generated by workflows/release.yml.
51100 files : |
52- dist/
101+ dist/*
53102
54- # - name: Upload to PyPI
55- # if: inputs.upload_to_pypi == true
103+ # - name: Upload wheels to PyPI
104+ # if: inputs.upload_to_pypi == ' true'
56105 # run: |
57- # python -m pip install twine
58- # python -m twine upload --verbose --skip-existing dist/*
106+ # python -m twine upload -u __token__ dist/*
107+ # # Maybe the token should not be used, according to https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/#configuring-trusted-publishing
0 commit comments