chore: patch v1.2.7 release #31
Workflow file for this run
This file contains hidden or 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: Release | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
get_version: | |
name: Get Version | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.version.outputs.version }} | |
refname: ${{ steps.refname.outputs.refname }} | |
steps: | |
- id: version | |
run: echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT | |
- id: refname | |
run: echo "refname=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT | |
publish_pypi: | |
name: Publish to PyPI | |
needs: get_version | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/project/torrra | |
permissions: | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v5 | |
- name: Install uv and setup the python version | |
uses: astral-sh/setup-uv@v6 | |
- name: Install the project | |
run: uv sync --all-groups | |
- name: Build wheel | |
run: uv build | |
- name: Publish package | |
run: uv publish | |
publish_docker: | |
name: Publish to Docker Hub | |
needs: get_version | |
runs-on: ubuntu-latest | |
environment: | |
name: dockerhub | |
url: https://hub.docker.com/r/stabldev/torrra | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v5 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ vars.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
push: true | |
tags: | | |
${{ vars.DOCKERHUB_USERNAME }}/torrra:latest | |
${{ vars.DOCKERHUB_USERNAME }}/torrra:${{ needs.get_version.outputs.version }} | |
build_and_release_binaries: | |
name: Build on ${{ matrix.os }} | |
needs: get_version | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v5 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.13" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e . | |
pip install pyinstaller | |
- name: Build standalone binary | |
run: pyinstaller torrra.spec | |
- name: Rename binary by platform | |
shell: bash | |
run: | | |
mkdir -p dist-out | |
ARCH=$(uname -m) | |
if [[ "$RUNNER_OS" == "Linux" ]]; then | |
chmod +x dist/torrra | |
cp dist/torrra "dist-out/torrra_${{ needs.get_version.outputs.refname }}_linux_${ARCH}" | |
elif [[ "$RUNNER_OS" == "Windows" ]]; then | |
cp dist/torrra.exe "dist-out/torrra_${{ needs.get_version.outputs.refname }}_windows_${ARCH}.exe" | |
elif [[ "$RUNNER_OS" == "macOS" ]]; then | |
chmod +x dist/torrra | |
cp dist/torrra "dist-out/torrra_${{ needs.get_version.outputs.refname }}_macos_${ARCH}" | |
fi | |
- name: Upload binary to release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: dist-out/* | |
token: ${{ secrets.GITHUB_TOKEN }} | |
publish_aur: | |
name: Publish to AUR | |
needs: | |
- get_version | |
- build_and_release_binaries | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v5 | |
- name: Publish torrra to AUR | |
uses: stabldev/aur-publish-action@v1 | |
with: | |
pkgname: torrra | |
pkgver: ${{ needs.get_version.outputs.version }} | |
pkgbuild_template: ./pkgbuild-template/torrra/PKGBUILD | |
aur_ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} | |
- name: Publish torrra-bin to AUR | |
uses: stabldev/aur-publish-action@v1 | |
with: | |
pkgname: torrra-bin | |
pkgver: ${{ needs.get_version.outputs.version }} | |
pkgbuild_template: ./pkgbuild-template/torrra-bin/PKGBUILD | |
aur_ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} |