Skip to content

Commit

Permalink
Fix workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
qqfunc authored Aug 16, 2024
1 parent 51fd03d commit c86de0d
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 28 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,35 +33,38 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
check-latest: true
- name: Set information outputs
id: info
- name: Set Python version information
id: py-ver
run: |
echo "python-version=$(python ./getversion.py)" >> $GITHUB_OUTPUT
echo "python-url=$(python ./geturl.py)" >> $GITHUB_OUTPUT
echo "long=$(python ./version.py long)" >> $GITHUB_OUTPUT
echo "short=$(python ./version.py short)" >> $GITHUB_OUTPUT
- name: Download Python ${{ matrix.python-version }} source code
run: >
gh release download
v${{ steps.py-ver.outputs.long }}
-A tar.gz
-O Python.tar.gz
- name: Extract Python source code archive
run: |
curl -O ${{ steps.info.outputs.python-url }}
tar -xzf Python-${{ steps.info.outputs.python-version }}.tgz
tar -xzf Python.tar.gz
- name: Add iOS/Resources/bin to PATH
working-directory: Python-${{ steps.info.outputs.python-version }}
run: |
echo "${{ github.workspace }}/Python/iOS/Resources/bin" >> $GITHUB_PATH
working-directory: Python-${{ steps.py-ver.outputs.long }}
run: echo "$(pwd)/iOS/Resources/bin" >> $GITHUB_PATH
- name: Configure
working-directory: Python-${{ steps.info.outputs.python-version }}
working-directory: Python-${{ steps.py-ver.outputs.long }}
run: >
./configure
--enable-framework="./iOS/Frameworks/main/"
--host=${{ matrix.build-host }}
--build=arm64-apple-darwin
--with-build-python="${{ steps.py.outputs.python-path }}"
; cat config.log
- name: Build Python.framework
working-directory: Python-${{ steps.info.outputs.python-version }}
working-directory: Python-${{ steps.py-ver.outputs.long }}
run: |
make
make install
- name: Create an archive
working-directory: Python-${{ steps.info.outputs.python-version }}
working-directory: Python-${{ steps.py-ver.outputs.long }}
run: >
tar -czf
./iOS/Frameworks/dist/Python.framework.tar.gz
Expand Down
9 changes: 0 additions & 9 deletions geturl.py

This file was deleted.

6 changes: 0 additions & 6 deletions getversion.py

This file was deleted.

15 changes: 15 additions & 0 deletions version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""Get version information of Python."""

import argparse
import platform
import sys

if __name__ == "__main__":
parser = argparse.ArgumentParser(__doc__)
parser.add_argument("mode", choices=["long", "short"])
parser.parse_args()

if parser.mode == "long":
print(platform.python_version())
else:
".".join(map(lambda n: str(n), sys.version_info[0:3]))

0 comments on commit c86de0d

Please sign in to comment.