Skip to content

Commit

Permalink
update to manual triggers in GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
liudonghua123 committed Sep 25, 2023
1 parent 34808bc commit 9b82563
Showing 1 changed file with 36 additions and 11 deletions.
47 changes: 36 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
name: Windows-build-CI

on:
push:
branches:
- '*'
tags:
- '*'
workflow_dispatch:
inputs:
branch:
description: 'The branch to build'
required: true
default: '3.12'
tag_short_version:
description: 'The short version of cpython upstream, eg: use 3.12.0 instead of v3.12.0'
required: true
default: '3.12.0'

jobs:
build:
Expand All @@ -18,18 +23,37 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive
ref: ${{ github.event.inputs.branch }}
- name: 'Checkout and push specified tag version of cpython'
run: |
git status
git branch
git config --global pull.rebase false
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
cd cpython
git status
git remote -v
git fetch
git checkout v${{ github.event.inputs.tag_short_version }}
cd ..
git add cpython
git commit -m "update python to ${{ github.event.inputs.tag_short_version }}"
git tag ${{ github.event.inputs.tag_short_version }}
git push
git push --tag
- name: Install HTML Help Workshop as hhc.exe is need when build chm
run: |
rem unzip resources/html_help_workshop.zip
resources\htmlhelp.exe /T:%cd%\html_help_workshop /C /Q
echo %cd%\html_help_workshop>> %GITHUB_PATH%
shell: cmd
- name: Testing ${{ github.ref_name }}...
- name: Testing ${{ github.event.inputs.tag_short_version }}...
run: |
echo %PATH%
where hh hhc
echo GITHUB_REF_NAME: %GITHUB_REF_NAME%
echo github.ref_name: ${{ github.ref_name }}
echo github.event.inputs.tag_short_version: ${{ github.event.inputs.tag_short_version }}
shell: cmd
- uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -79,13 +103,14 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.tag_short_version }}
file: |-
cpython/Doc/build/htmlhelp/python*.chm;
cpython/PCbuild/win32/en-us/python-${{ github.ref_name }}-embed-win32.zip;
cpython/PCbuild/win32/en-us/python-${{ github.ref_name }}.exe;
cpython/PCbuild/win32/en-us/python-${{ github.event.inputs.tag_short_version }}-embed-win32.zip;
cpython/PCbuild/win32/en-us/python-${{ github.event.inputs.tag_short_version }}.exe;
cpython/PCbuild/win32/en-us/python*.nupkg;
cpython/PCbuild/amd64/en-us/python-${{ github.ref_name }}-embed-amd64.zip;
cpython/PCbuild/amd64/en-us/python-${{ github.ref_name }}-amd64.exe;
cpython/PCbuild/amd64/en-us/python-${{ github.event.inputs.tag_short_version }}-embed-amd64.zip;
cpython/PCbuild/amd64/en-us/python-${{ github.event.inputs.tag_short_version }}-amd64.exe;
cpython/PCbuild/amd64/en-us/python*.nupkg;
tags: true
draft: false
Expand Down

0 comments on commit 9b82563

Please sign in to comment.