Skip to content

Commit f97af39

Browse files
authored
Refactor init-python workflow for clarity and updates
1 parent f242177 commit f97af39

1 file changed

Lines changed: 51 additions & 55 deletions

File tree

.github/workflows/init-python.yml

Lines changed: 51 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,56 @@
11
name: init-python
22

33
on:
4-
push:
4+
push:
55

66
jobs:
7-
build:
8-
runs-on: windows-latest
9-
10-
# 👇 権限を追加!
11-
permissions:
12-
contents: write # Release作成に必要
13-
14-
steps:
15-
- name: Check out code
16-
uses: actions/checkout@v5
17-
18-
- name: Python Embeddable Download
19-
run: Invoke-WebRequest -Uri https://www.python.org/ftp/python/3.13.7/python-3.13.7-embed-amd64.zip -Outfile Python.zip
20-
21-
- name: Python Embeddable Setup
22-
run: |
23-
Expand-Archive .\Python.zip -DestinationPath .\Python\
24-
(Get-Content .\Python\Python313._pth) -replace '#import site', 'import site' | Set-Content .\Python\Python313._pth
25-
26-
Invoke-WebRequest -Uri https://bootstrap.pypa.io/get-pip.py -Outfile .\Python\get-pip.py
27-
.\Python\Python.exe .\Python\get-pip.py
28-
.\Python\Python.exe -m pip install -U pip
29-
# $env:UV_INSTALL_DIR = (pwd).Path + '\python'
30-
# irm https://astral.sh/uv/install.ps1 | iex
31-
32-
- name: Python Embeddable Setup Dependencies
33-
run: |
34-
.\Python\Python.exe -m pip install pandas
35-
36-
- name: Compress Python
37-
run: Compress-Archive -Path .\Python\* -DestinationPath .\Python_Embeddable.zip
38-
39-
- name: Update Release (always update latest release)
40-
uses: softprops/action-gh-release@v2
41-
with:
42-
tag_name: latest
43-
name: Python Embeddable with UV
44-
body: |
45-
## Python Embeddable with UV and Pandas
46-
47-
- **Python Version**: 3.13.7
48-
- **Package Manager**: -
49-
- **Added Package**: pandas
50-
- **Build Date**: ${{ github.event.head_commit.timestamp }}
51-
- **Commit**: ${{ github.sha }}
52-
53-
*This release is automatically updated on every push*
54-
files: |
55-
./Python_Embeddable.zip
56-
# 👇 overwriteパラメータを削除(同じtag_nameを指定すれば自動的に更新される)
57-
make_latest: true
58-
env:
59-
60-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7+
build:
8+
runs-on: windows-latest
9+
10+
# Release作成に必要
11+
permissions:
12+
contents: write
13+
14+
steps:
15+
- name: Check out code
16+
uses: actions/checkout@v5
17+
18+
- name: Python Embeddable Download
19+
run: Invoke-WebRequest -Uri https://www.python.org/ftp/python/3.13.7/python-3.13.7-embed-amd64.zip -OutFile Python.zip
20+
21+
- name: Python Embeddable Setup
22+
run: |
23+
Expand-Archive .\Python.zip -DestinationPath .\Python\
24+
(Get-Content .\Python\Python313._pth) -replace '#import site', 'import site' | Set-Content .\Python\Python313._pth
25+
26+
Invoke-WebRequest -Uri https://bootstrap.pypa.io/get-pip.py -OutFile .\Python\get-pip.py
27+
.\Python\Python.exe .\Python\get-pip.py
28+
.\Python\Python.exe -m pip install -U pip
29+
30+
- name: Python Embeddable Setup Dependencies
31+
run: |
32+
.\Python\Python.exe -m pip install pandas
33+
34+
- name: Compress Python
35+
run: Compress-Archive -Path .\Python\* -DestinationPath .\Python_Embeddable.zip
36+
37+
- name: Update Release (always update latest release)
38+
uses: softprops/action-gh-release@v2
39+
with:
40+
tag_name: latest
41+
name: Python Embeddable with pandas
42+
body: |
43+
## Python Embeddable with pandas
44+
45+
- **Python Version**: 3.13.7
46+
- **Package Manager**: pip
47+
- **Added Package**: pandas
48+
- **Build Date**: ${{ github.event.head_commit.timestamp }}
49+
- **Commit**: ${{ github.sha }}
50+
51+
*This release is automatically updated on every push*
52+
files: |
53+
./Python_Embeddable.zip
54+
make_latest: true
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)