v0.30 下载🎉 #40
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 | |
on: | |
release: | |
types: [ created ] | |
env: | |
APP_NAME: 'Kafka-King' | |
jobs: | |
build-windows: | |
runs-on: windows-2022 | |
# 步骤合集 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
echo -n ${{ github.ref_name }} > assets/version.txt | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
flet pack main.py -i assets/icon.ico -n ${{ env.APP_NAME }}-${{ github.ref_name }} --distpath dist/Kafka-King --add-data=assets/*:assets --product-name ${{ env.APP_NAME }} | |
copy README.md dist/Kafka-King/ | |
copy LICENSE dist/Kafka-King/ | |
Compress-Archive -Path ./dist/kafka-King -DestinationPath ${{ env.APP_NAME }}-${{ github.ref_name }}-windows-amd64.zip -CompressionLevel Optimal | |
- name: Upload Release Asset | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: ${{ env.APP_NAME }}-${{ github.ref_name }}-windows-amd64.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-macos: | |
strategy: | |
matrix: | |
os: [macos-13, macos-14] # 定义多个 macOS 版本,macos-14是m1芯片即arm64 | |
name: Build on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
# 步骤合集 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
echo -n ${{ github.ref_name }} > assets/version.txt | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
flet pack main.py -i assets/icon.icns -n ${{ env.APP_NAME }}-${{ github.ref_name }} --add-data=assets/*:assets --product-name ${{ env.APP_NAME }} | |
ls -al dist/ | |
# 打包.app文件夹为zip或tar.gz以方便传输 | |
- name: Package .app folder | |
run: | | |
cd dist | |
tar -czf ${{ env.APP_NAME }}-${{ github.ref_name }}-${{ matrix.os }}.tar.gz ${{ env.APP_NAME }}-${{ github.ref_name }}.app | |
- name: Upload Release Asset | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: ./dist/${{ env.APP_NAME }}-${{ github.ref_name }}-${{ matrix.os }}.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-ubuntu: | |
runs-on: ubuntu-22.04 | |
# 步骤合集 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
echo -n ${{ github.ref_name }} > assets/version.txt | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
flet pack main.py -i assets/icon.ico -n ${{ env.APP_NAME }}-${{ github.ref_name }} --add-data=assets/*:assets --product-name ${{ env.APP_NAME }} | |
ls -al dist/ | |
# 打包.app文件夹为zip或tar.gz以方便传输 | |
- name: Package .app folder | |
run: | | |
cp -r dist temp_dist | |
cd temp_dist | |
tar -czf ${{ env.APP_NAME }}-${{ github.ref_name }}-ubuntu-22.04.tar.gz ${{ env.APP_NAME }}-${{ github.ref_name }} | |
- name: Upload Release Asset | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: ./temp_dist/${{ env.APP_NAME }}-${{ github.ref_name }}-ubuntu-22.04.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |