Skip to content

配置自动发布

配置自动发布 #24

Workflow file for this run

name: Build
on:
push:
tags:
- '*'
jobs:
build:
name: Build App
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-latest, macos-latest, ubuntu-latest ]
steps:
- name: Check out
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
- name: Build
run: pyinstaller build.spec
- name: Upload (Windows)
if: ${{ runner.os == 'windows' }}
uses: actions/upload-artifact@v3
with:
name: SubtitleRenamer_windows
path: dist/*.exe
- name: Upload (macOS)
if: ${{ runner.os == 'macos' }}
uses: actions/upload-artifact@v3
with:
name: SubtitleRenamer_mac_x86
path: dist/*.app
- name: Upload (Linux)
if: ${{ runner.os == 'linux' }}
uses: actions/upload-artifact@v3
with:
name: SubtitleRenamer_linux
path: dist/*
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download
uses: actions/download-artifact@v3
- name: Display files
run: ls -R
- name: Move files
run: |
cp -r SubtitleRenamer_mac_x86/SubtitleRenamer.app .
cp SubtitleRenamer_windows/SubtitleRenamer.exe .
cp SubtitleRenamer_linux/SubtitleRenamer .
- name: ZIP
run: |
zip -r SubtitleRenamer_mac_x86.zip SubtitleRenamer.app
zip SubtitleRenamer_windows.zip SubtitleRenamer.exe
zip SubtitleRenamer_linux.zip SubtitleRenamer
- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: tag
draft: true
files: |
SubtitleRenamer_windows.zip
SubtitleRenamer_mac_x86.zip
SubtitleRenamer_linux.zip
name: 🎉
body: |
## 新增
- 新增内容
## 优化
- 优化内容