v0.1.5下载❤ #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
name: mac | |
on: | |
release: | |
types: [ created ] | |
jobs: | |
build-win: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
platform: | |
- windows/amd64 | |
# 步骤合集 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Normalise platform tag | |
id: normalise_platform | |
shell: bash | |
run: | | |
tag=$(echo ${{ matrix.platform }} | sed -e 's/\//_/g') | |
echo "tag=$tag" >> "$GITHUB_OUTPUT" | |
- 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.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- 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 kafka-king --add-data=assets/*:assets | |
- 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/kafka-king.exe | |
asset_name: kafka-king_${{ steps.normalise_version.outputs.version }}_${{ steps.normalise_platform.outputs.tag }}.exe # 替换成适当的版本和平台标记 | |
asset_content_type: application/octet-stream # 对于.exe文件,可以是application/octet-stream | |
build-mac: | |
runs-on: macos-latest | |
# 步骤合集 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Normalise platform tag | |
id: normalise_platform | |
shell: bash | |
run: | | |
tag=$(echo ${{ matrix.platform }} | sed -e 's/\//_/g' -e 's/darwin/mac/g' -e 's/amd64/intel/g') | |
echo "tag=$tag" >> "$GITHUB_OUTPUT" | |
- 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.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- 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 kafka-king --add-data=assets/*:assets | |
ls -al dist/ | |
# 打包.app文件夹为zip或tar.gz以方便传输 | |
- name: Package .app folder | |
run: | | |
cd dist | |
tar -czf kafka-king-macos.tar.gz kafka-king.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/kafka-king-macos.tar.gz | |
asset_name: kafka-king_${{ steps.normalise_version.outputs.version }}_macos.tar.gz | |
asset_content_type: application/octet-stream |