Skip to content

Commit 8fbcedd

Browse files
committed
ci: refactor workflows
autoupdate: use GITHUB_OUTPUT instead of GITHUB_ENV release: rename to buildrelease and simplify steps
1 parent 4bed788 commit 8fbcedd

2 files changed

Lines changed: 20 additions & 18 deletions

File tree

.github/workflows/autoupdate.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ jobs:
1616
token: ${{ secrets.COATL_BOT_GH_TOKEN }}
1717

1818
- name: Fetch latest Python 3.12 release
19+
id: get-python-version
1920
run: |
2021
python_version=$(curl -s https://www.python.org/ftp/python/ | grep -oP '3\.12\.\d+/' | uniq | sort -V | tail -n 1 | tr -d '/')
2122
2223
echo "python3.12: $python_version"
2324
2425
echo ${python_version} > .python_version
25-
echo "PYTHON_VERSION=${python_version}" >> $GITHUB_ENV
26+
echo "python_version=${python_version}" >> $GITHUB_OUTPUT
2627
2728
- name: Detect changes
2829
id: git-diff
@@ -40,6 +41,9 @@ jobs:
4041
if: ${{ steps.git-diff.outputs.diff == 'true' }}
4142
run: |
4243
git add -u
43-
git commit -m "release: ${{ env.PYTHON_VERSION }}"
44-
git tag -a ${{ env.PYTHON_VERSION }} -m "${{ env.PYTHON_VERSION }}"
44+
git commit \
45+
-m "release: ${{ steps.get-python-version.outputs.python_version }}"
46+
git tag \
47+
-a ${{ steps.get-python-version.outputs.python_version }} \
48+
-m "${{ steps.get-python-version.outputs.python_version }}"
4549
git push --tags
Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
name: release
1+
name: buildrelease
22

33
on:
44
push:
55
tags:
66
- 3.12.*
77

88
jobs:
9-
build:
9+
buildrelease:
10+
env:
11+
GITHUB_TOKEN: ${{ secrets.COATL_BOT_GH_TOKEN }}
1012
runs-on: windows-latest
1113
steps:
1214
- name: Checkout repository
1315
uses: actions/checkout@v4
1416
with:
1517
fetch-depth: 0
16-
token: ${{ secrets.COATL_BOT_GH_TOKEN }}
18+
token: ${{ env.GITHUB_TOKEN }}
1719

1820
- name: Download Python 3.12
1921
run: |
@@ -45,8 +47,7 @@ jobs:
4547

4648
- name: Building ...
4749
run: |
48-
.\Tools\msi\buildrelease.bat -x86
49-
.\Tools\msi\buildrelease.bat -x64
50+
.\Tools\msi\buildrelease.bat
5051
working-directory: Python-${{ github.ref_name }}
5152
shell: powershell
5253

@@ -55,20 +56,17 @@ jobs:
5556
gh release create "${{ github.ref_name }}" \
5657
--title "${{ github.ref_name }}" \
5758
--notes "Automated release for version ${{ github.ref_name }}"
58-
env:
59-
GITHUB_TOKEN: ${{ secrets.COATL_BOT_GH_TOKEN }}
6059
shell: bash
6160

6261
- name: Upload artifacts to GitHub release
6362
run: |
6463
gh release upload "${{ github.ref_name }}" `
6564
--clobber `
66-
Python-${{ github.ref_name }}\PCbuild\win32\en-us\python-${{ github.ref_name }}.exe `
67-
Python-${{ github.ref_name }}\PCbuild\win32\en-us\python-${{ github.ref_name }}-embed-win32.zip `
68-
Python-${{ github.ref_name }}\PCbuild\win32\en-us\pythonx86.${{ github.ref_name }}.nupkg `
69-
Python-${{ github.ref_name }}\PCbuild\amd64\en-us\python.${{ github.ref_name }}.nupkg `
70-
Python-${{ github.ref_name }}\PCbuild\amd64\en-us\python-${{ github.ref_name }}-amd64.exe `
71-
Python-${{ github.ref_name }}\PCbuild\amd64\en-us\python-${{ github.ref_name }}-embed-amd64.zip
72-
env:
73-
GITHUB_TOKEN: ${{ secrets.COATL_BOT_GH_TOKEN }}
65+
.\PCbuild\win32\en-us\python-${{ github.ref_name }}.exe `
66+
.\PCbuild\win32\en-us\python-${{ github.ref_name }}-embed-win32.zip `
67+
.\PCbuild\win32\en-us\pythonx86.${{ github.ref_name }}.nupkg `
68+
.\PCbuild\amd64\en-us\python.${{ github.ref_name }}.nupkg `
69+
.\PCbuild\amd64\en-us\python-${{ github.ref_name }}-amd64.exe `
70+
.\PCbuild\amd64\en-us\python-${{ github.ref_name }}-embed-amd64.zip
71+
working-directory: Python-${{ github.ref_name }}
7472
shell: powershell

0 commit comments

Comments
 (0)