Skip to content

Auto-Release

Auto-Release #6

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Auto-Release
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
schedule:
- cron: 0 0 1 * *
# Allows you to run this workflow manually from the Actions tab
push:
tags:
- "*.*.*"
workflow_dispatch:
inputs:
version:
description: "版本号"
type: string
required: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build-Windows:
# The type of runner that the job will run on
runs-on: windows-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/[email protected]
with:
# Version range or exact version of Python to use, using SemVer's version range syntax. Reads from .python-version if unset.
python-version: '3.11'
# Runs a single command using the runners shell
- name: Install pip
run: pip install -r requirements.txt
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.19.6
# Runs a set of commands using the runners shell
- name: flet
run: |
flet build windows --module-name HT_Music_Downloader.py --include-packages flet_audio
Compress-Archive -Path ./build/windows -DestinationPath HT-Music-Downloader-Windows.zip
# ren ./build/HT_Music_Downloader.exe "HT-Music-Downloader-Windows.exe"
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
# Artifact name
name: HT-Music-Downloader-Windows
# A file, directory or wildcard pattern that describes what to upload
path: HT-Music-Downloader-Windows.zip
build-MacOS:
# The type of runner that the job will run on
runs-on: macos-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/[email protected]
with:
# Version range or exact version of Python to use, using SemVer's version range syntax. Reads from .python-version if unset.
python-version: '3.11'
# Runs a single command using the runners shell
- name: Install pip
run: pip install -r requirements.txt
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.19.6
# Runs a set of commands using the runners shell
- name: flet
run: |
flet build macos --module-name HT_Music_Downloader.py --include-packages flet_audio
zip -vr HT-Music-Downloader-MacOS.zip build/macos/ -x "*.DS_Store"
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
# Artifact name
name: HT-Music-Downloader-MacOS
# A file, directory or wildcard pattern that describes what to upload
path: HT-Music-Downloader-MacOS.zip
build-Linux:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/[email protected]
with:
# Version range or exact version of Python to use, using SemVer's version range syntax. Reads from .python-version if unset.
python-version: '3.11'
# Runs a single command using the runners shell
- name: Install pip
run: pip install -r requirements.txt
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.19.6
# Runs a set of commands using the runners shell
- name: flet
run: |
sudo apt install libgtk-3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev
flet build linux --module-name HT_Music_Downloader.py --include-packages flet_audio
zip -r HT-Music-Downloader-Linux build/linux/
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
# Artifact name
name: HT-Music-Downloader-Linux
# A file, directory or wildcard pattern that describes what to upload
path: HT-Music-Downloader-Linux.zip
Auto_release:
needs: [build-Windows,build-Macos,build-Linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: HT-Music-Downloader-Linux
path: zip/Linux
- uses: vimtor/action-zip@v1
with:
files: zip/Linux
dest: HT-Music-Downloader-Linux.zip
- uses: actions/download-artifact@v2
with:
name: HT-Music-Downloader-MacOS
path: zip/MacOS
- uses: vimtor/action-zip@v1
with:
files: zip/MacOS
dest: HT-Music-Downloader-MacOS.zip
- uses: actions/download-artifact@v2
with:
name: HT-Music-Downloader-Windows
path: zip/Windows
- uses: vimtor/action-zip@v1
with:
files: zip/Windows
dest: HT-Music-Downloader-Windows.zip
- name: Release
uses: softprops/action-gh-release@v1
if: github.event_name=='workflow_dispatch'
with:
tag_name: "${{ github.event.inputs.version }}"
# Should this release be marked as a draft?
draft: false
generate_release_notes: true
# Should this release be marked as a pre-release?
prerelease: true # optional, default is true
# Release title (for automatic releases)
name: "${{ github.event.inputs.version }} - CI"
# Assets to upload to the release
files: |
*.zip