mirror of
https://github.com/CodeSeeed/sbackup.git
synced 2026-10-02 18:32:58 +08:00
96 lines
2.8 KiB
YAML
96 lines
2.8 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
publish-pypi:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v3
|
|
with:
|
|
version: "latest"
|
|
- name: Build
|
|
run: uv build
|
|
- name: Publish to PyPI
|
|
run: uv publish --token ${{ secrets.PYPI_TOKEN }}
|
|
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- os: windows-latest
|
|
platform: windows
|
|
arch: x64
|
|
ext: .exe
|
|
- os: macos-13
|
|
platform: macos
|
|
arch: x86_64
|
|
ext: ""
|
|
- os: macos-latest
|
|
platform: macos
|
|
arch: arm64
|
|
ext: ""
|
|
- os: ubuntu-latest
|
|
platform: linux
|
|
arch: x86_64
|
|
ext: ""
|
|
- os: ubuntu-24.04-arm
|
|
platform: linux
|
|
arch: aarch64
|
|
ext: ""
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
- name: Install dependencies
|
|
run: pip install nuitka py7zr tqdm zstandard paramiko minio reedsolo watchdog
|
|
- name: Extract version
|
|
id: version
|
|
shell: bash
|
|
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
|
|
- name: Read release notes
|
|
id: notes
|
|
shell: bash
|
|
run: |
|
|
NOTES_FILE="releases/v${{ steps.version.outputs.VERSION }}.md"
|
|
if [ -f "$NOTES_FILE" ]; then
|
|
echo "NOTES<<EOF" >> $GITHUB_OUTPUT
|
|
cat "$NOTES_FILE" >> $GITHUB_OUTPUT
|
|
echo "" >> $GITHUB_OUTPUT
|
|
echo "EOF" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "NOTES=Release v${{ steps.version.outputs.VERSION }}" >> $GITHUB_OUTPUT
|
|
fi
|
|
- name: Build executable
|
|
shell: bash
|
|
run: |
|
|
python -m nuitka \
|
|
--onefile \
|
|
--assume-yes-for-downloads \
|
|
--output-filename=sbackup-${{ steps.version.outputs.VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}${{ matrix.ext }} \
|
|
--include-package=sbackup \
|
|
--include-data-dir=sbackup/locales=sbackup/locales \
|
|
--include-package=py7zr \
|
|
--include-package=tqdm \
|
|
--include-package=zstandard \
|
|
--include-package=paramiko \
|
|
--include-package=minio \
|
|
--include-package=reedsolo \
|
|
--include-package=watchdog \
|
|
main.py
|
|
- name: Upload to Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
body: ${{ steps.notes.outputs.NOTES }}
|
|
files: sbackup-${{ steps.version.outputs.VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}${{ matrix.ext }}
|