Skip to content

Commit

Permalink
Merge 595b046 into 3900cac
Browse files Browse the repository at this point in the history
  • Loading branch information
thelastfantasy authored Oct 19, 2024
2 parents 3900cac + 595b046 commit ccdd9ee
Showing 1 changed file with 38 additions and 15 deletions.
53 changes: 38 additions & 15 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ name: Create Tag and Release

on:
pull_request:
types: [closed]
types: [closed, synchronize]
branches:
- main
- 1.2.0-release-2

concurrency:
group: create-tag-and-release-${{ github.ref }}
Expand All @@ -13,7 +14,7 @@ concurrency:
jobs:
# Job 1: Validate the PR and extract version
validate_and_tag:
if: github.event.pull_request.merged == true
# if: github.event.pull_request.merged == true
runs-on: ubuntu-latest

outputs:
Expand Down Expand Up @@ -81,34 +82,56 @@ jobs:
architecture: ${{ matrix.architecture || '' }}

- name: Install Dependencies
if: runner.os != 'Windows'
run: |
if [ -f src/requirements.txt ]; then
pip install -r src/requirements.txt
if [ -f requirements.txt ]; then
pip install -r requirements.txt
fi
shell: bash

- name: Install Dependencies (Windows)
if: runner.os == 'Windows'
run: |
if (Test-Path -Path requirements.txt) {
pip install -r requirements.txt
}
shell: pwsh

- name: Install PyInstaller
run: |
pip install pyinstaller
- name: Compile for ${{ matrix.os }}
- name: Compile for Linux and macOS
if: runner.os != 'Windows'
run: |
cd src
# 直接在项目根目录下执行 PyInstaller
pyinstaller --onefile sub_adjust.py
pyinstaller --onefile sub_converter.py
cd ..
# 移动编译后的文件到对应的 build 目录
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
mkdir -p build/linux
mv src/dist/sub_adjust build/linux/
mv src/dist/sub_converter build/linux/
elif [ "${{ matrix.os }}" == "windows-latest" ]; then
mkdir -p build/windows
mv src/dist/sub_adjust.exe build/windows/
mv src/dist/sub_converter.exe build/windows/
mv dist/sub_adjust build/linux/
mv dist/sub_converter build/linux/
elif [ "${{ matrix.os }}" == "macos-latest" ]; then
mkdir -p build/macos
mv src/dist/sub_adjust build/macos/
mv src/dist/sub_converter build/macos/
mv dist/sub_adjust build/macos/
mv dist/sub_converter build/macos/
fi
shell: bash

- name: Compile for Windows
if: runner.os == 'Windows'
run: |
# 直接在项目根目录下执行 PyInstaller
pyinstaller --onefile sub_adjust.py
pyinstaller --onefile sub_converter.py
# 移动编译后的文件到对应的 build 目录
mkdir -p build/windows
mv dist/sub_adjust.exe build/windows/
mv dist/sub_converter.exe build/windows/
shell: pwsh

# Job 3: Create release
create_release:
Expand Down

0 comments on commit ccdd9ee

Please sign in to comment.