Skip to content

ture->true

ture->true #30

Workflow file for this run

name: Build And Release
on:
push:
paths:
# - '**.py'
- '**.yml'
workflow_dispatch:
inputs:
release:
description: 'Create a new release'
required: false
default: 'true'
version:
description: 'Release version'
required: false
default: '2024.06.12v1'
body:
description: 'Release body text'
required: false
default: '详情请查看更新日志'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11.9
- name: Install Pyinstaller
run: |
python -m pip install pyinstaller
- name: Build the executable for decrypt_epub
run: |
pyinstaller --onefile --name decrypt_epub 重构epub并反文件名混淆.py
- name: Build the executable for encrypt_epub
run: |
pyinstaller --onefile --name encrypt_epub 重构epub并加入文件名混淆.py
- name: Build the executable for rebuild_epub
run: |
pyinstaller --onefile --name rebuild_epub 重构epub为规范格式_v2.8.3.py
- name: Upload the decrypt_epub executable
if: github.event.inputs.release != 'true'
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-decrypt_epub
path: dist/decrypt_epub${{ endsWith(matrix.os, 'windows-latest') && '.exe' || '' }}
if-no-files-found: warn
- name: Upload the encrypt_epub executable
if: github.event.inputs.release != 'true'
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-encrypt_epub
path: dist/encrypt_epub${{ endsWith(matrix.os, 'windows-latest') && '.exe' || '' }}
if-no-files-found: warn
- name: Upload the rebuild_epub executable
if: github.event.inputs.release != 'true'
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-rebuild_epub
path: dist/rebuild_epub${{ endsWith(matrix.os, 'windows-latest') && '.exe' || '' }}
if-no-files-found: warn
- name: Upload all executables
if: github.event.inputs.release != 'true'
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-all
path: dist/*
- name: Rename artifacts with OS prefix (Linux and macOS)
if: github.event.inputs.release == 'true' && matrix.os != 'windows-latest'
run: |
for file in dist/*; do
mv "$file" "dist/${{ runner.os }}_$(basename "$file")"
done
shell: bash
- name: Rename artifacts with OS prefix (Windows)
if: github.event.inputs.release == 'true' && matrix.os == 'windows-latest'
run: |
Get-ChildItem -Path dist | Rename-Item -NewName { '${{ runner.os }}_' + $_.Name }
shell: pwsh
- name: Create Release
if: github.event.inputs.release == 'true'
uses: ncipollo/release-action@v1
with:
tag: ${{ github.event.inputs.version }}
name: ${{ github.event.inputs.version }}
body: ${{ github.event.inputs.body }}
artifacts: 'dist/*'
allowUpdates: true
makeLatest: true