diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index edeb8e066..b679e54fd 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -3,15 +3,22 @@ name: docs on: create: tags: - # https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet + # https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet - b[0-9][0-9][0-9] - publish-docs* push: branches: - main + pull_request: + branches: + - main + paths: + - 'AutoDuck/**' + - '**/.html' + - .github/workflows/docs.yml jobs: - decompile: + generate: runs-on: windows-latest steps: @@ -19,47 +26,38 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 - with: - python-version: '3.9' - - name: Install latest release - run: pip install --user --upgrade pywin32 + - name: Generate help file + run: python AutoDuck/make.py - - name: Set Python user site directory - run: python -c "import os,site;open(os.environ['GITHUB_ENV'], 'a').write(f'USER_DIR={site.USER_SITE}\n')" - - - name: Decompile shipped help file - run: hh -decompile site ${env:USER_DIR}\PyWin32.chm + - name: Decompile help file + run: hh -decompile site PyWin32.chm - name: Rename root HTML file run: mv site\PyWin32.HTML site\index.html - # Compress first to avoid slowly uploading thousands of individual files - - name: Create archive - run: python -m zipfile -c site.zip site - - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: documentation - path: site.zip + path: site/ publish: runs-on: ubuntu-latest needs: - - decompile + - generate # Only publish tags if: github.event_name == 'create' && github.event.ref_type == 'tag' steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: documentation - name: Unpack archive run: python -m zipfile -e site.zip . - - uses: peaceiris/actions-gh-pages@v3 + - uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: site diff --git a/AutoDuck/README b/AutoDuck/README.md similarity index 77% rename from AutoDuck/README rename to AutoDuck/README.md index 5d0520aed..192828d79 100644 --- a/AutoDuck/README +++ b/AutoDuck/README.md @@ -1,4 +1,4 @@ -Just run MAKE.BAT to build the documentation. +Just run [make.py](./make.py) to build the documentation. Main focus these days is on the .chm file - a single .chm provides the best documentation solution. We don't even diff --git a/AutoDuck/common_top.mak b/AutoDuck/common_top.mak index a76ffcda9..a2ebbd9e0 100644 --- a/AutoDuck/common_top.mak +++ b/AutoDuck/common_top.mak @@ -1,13 +1,12 @@ # Common AutoDuck make file -AD = bin\autoduck.exe /Spythonwin.fmt +AD = bin\autoduck.exe /Spythonwin.fmt ADHTMLFMT = bin\autoduck.exe /Spyhtml.fmt ADHTMLLOG = /R html "/L$(GENDIR)\$(TARGET).HHLOG" /N -ADLOG = /R help "/L$(GENDIR)\$(TARGET).HLOG" /N -ADHTML = /R html "/G$(GENDIR)\$(TARGET).DUMP" "/C$(GENDIR)\$(TARGET).HHLOG" "/I$(GENDIR)\$(TARGET).IDX" "/O$(GENDIR)\$(TARGET).HTML" /D "title=$(TITLE)" -ADHLP = /R help "/C$(GENDIR)\$(TARGET).HLOG" "/O$(GENDIR)\$(TARGET).RTF" /D "title=$(TITLE)" -ADDOC = /RD "/O$(GENDIR)\$(TARGET).DOC" /D "doc_header=$(DOCHDR)" -ADTAB = 8 -HC = hcw /a /c /e -HHC = hhc -PYTHON = py -2.7 +ADLOG = /R help "/L$(GENDIR)\$(TARGET).HLOG" /N +ADHTML = /R html "/G$(GENDIR)\$(TARGET).DUMP" "/C$(GENDIR)\$(TARGET).HHLOG" "/I$(GENDIR)\$(TARGET).IDX" "/O$(GENDIR)\$(TARGET).HTML" /D "title=$(TITLE)" +ADHLP = /R help "/C$(GENDIR)\$(TARGET).HLOG" "/O$(GENDIR)\$(TARGET).RTF" /D "title=$(TITLE)" +ADDOC = /RD "/O$(GENDIR)\$(TARGET).DOC" /D "doc_header=$(DOCHDR)" +ADTAB = 8 +HC = hcw /a /c /e +HHC = hhc diff --git a/AutoDuck/make.py b/AutoDuck/make.py index d3b9ee39a..c205aa0da 100644 --- a/AutoDuck/make.py +++ b/AutoDuck/make.py @@ -26,5 +26,7 @@ ).splitlines()[-1] subprocess.run( - [nmake, "-E", "-f", "pywin32.mak"], cwd=os.path.dirname(sys.argv[0]), check=True + [nmake, f'PYTHON="{sys.executable}"', "-E", "-f", "pywin32.mak"], + cwd=os.path.dirname(sys.argv[0]), + check=True, )