v0.11版本下载❤ #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://docs.github.com/zh/actions/using-jobs/choosing-the-runner-for-a-job | |
name: build-xxx | |
# 以下是 release 事件中可用的 types 选项: | |
# | |
# created:当一个新的发布版本被创建时触发。 | |
# edited:当一个发布版本被编辑时触发。 | |
# deleted:当一个发布版本被删除时触发。 | |
# published:当一个发布版本被发布时触发。 | |
# unpublished:当一个发布版本被取消发布时触发。 | |
# prereleased:当一个预发布版本被发布时触发。 | |
# released:当一个预发布版本被标记为正式发布时触发。 | |
on: | |
release: | |
types: [ created ] | |
jobs: | |
build-windows: | |
runs-on: windows-2022 | |
# strategy: | |
# matrix: | |
# platform: | |
# - windows/amd64 | |
# - windows/arm64 | |
# 步骤合集 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Normalise version tag | |
id: normalise_version | |
shell: bash | |
run: | | |
version=$(echo ${{ github.event.release.tag_name }} | sed -e 's/v//g') | |
echo "version=$version" >> "$GITHUB_OUTPUT" | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
echo -n ${{ github.event.release.tag_name }} > assets/version.txt | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
flet pack main.py -i assets/icon.ico -n ES-King-v${{ steps.normalise_version.outputs.version }} --distpath dist/ES-King --add-data=assets/*:assets --product-name ES-King | |
copy README.md dist/ES-King/ | |
copy LICENSE dist/ES-King/ | |
Compress-Archive -Path ./dist/ES-King -DestinationPath dist.zip -CompressionLevel Optimal | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./dist.zip | |
asset_name: ES-King-v${{ steps.normalise_version.outputs.version }}-windows-2022.zip # 替换成适当的版本和平台标记 | |
asset_content_type: application/octet-stream # 对于.exe文件,可以是application/octet-stream | |
build-macos: | |
strategy: | |
matrix: | |
os: [macos-12, macos-13, macos-14] # 定义多个 macOS 版本,macos-14是m1芯片 | |
name: Build on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
# 步骤合集 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Normalise version tag | |
id: normalise_version | |
shell: bash | |
run: | | |
version=$(echo ${{ github.event.release.tag_name }} | sed -e 's/v//g') | |
echo "version=$version" >> "$GITHUB_OUTPUT" | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
echo -n ${{ github.event.release.tag_name }} > assets/version.txt | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
flet pack main.py -i assets/icon.icns -n ES-King-v${{ steps.normalise_version.outputs.version }} --add-data=assets/*:assets --product-name ES-King | |
ls -al dist/ | |
# 打包.app文件夹为zip或tar.gz以方便传输 | |
- name: Package .app folder | |
run: | | |
cd dist | |
tar -czf ES-King-v${{ steps.normalise_version.outputs.version }}.tar.gz ES-King-v${{ steps.normalise_version.outputs.version }}.app | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./dist/ES-King-v${{ steps.normalise_version.outputs.version }}.tar.gz | |
asset_name: ES-King-v${{ steps.normalise_version.outputs.version }}-${{ matrix.os }}.tar.gz | |
asset_content_type: application/octet-stream | |
build-ubuntu: | |
runs-on: ubuntu-22.04 | |
# strategy: | |
# matrix: | |
# platform: | |
# - linux/amd64 | |
# 步骤合集 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Normalise version tag | |
id: normalise_version | |
shell: bash | |
run: | | |
version=$(echo ${{ github.event.release.tag_name }} | sed -e 's/v//g') | |
echo "version=$version" >> "$GITHUB_OUTPUT" | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
echo -n ${{ github.event.release.tag_name }} > assets/version.txt | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
flet pack main.py -i assets/icon.ico -n ES-King-v${{ steps.normalise_version.outputs.version }} --add-data=assets/*:assets --product-name ES-King | |
ls -al dist/ | |
# 打包.app文件夹为zip或tar.gz以方便传输 | |
# 为啥linux的要cp,因为我测试老是文件变动无法压缩 | |
- name: Package .app folder | |
run: | | |
cp -r dist temp_dist | |
cd temp_dist | |
tar -czf ES-King-v${{ steps.normalise_version.outputs.version }}.tar.gz ES-King-v${{ steps.normalise_version.outputs.version }} | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./temp_dist/ES-King-v${{ steps.normalise_version.outputs.version }}.tar.gz | |
asset_name: ES-King-v${{ steps.normalise_version.outputs.version }}-ubuntu-22.04.tar.gz | |
asset_content_type: application/octet-stream |