Release #37
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: Release | |
on: | |
workflow_dispatch: # trigger it manually | |
permissions: | |
attestations: write | |
id-token: write | |
packages: write | |
env: | |
QBT_VERSION: "4.6.7" | |
# This is a positive integer number that allows to differentiate between consecutive builds of the same qBittorrent version. | |
# When `QBT_VERSION` is incremented, this value must reset to 1. | |
TAG_RELEASE_NUMBER: 1 | |
jobs: | |
build: | |
name: Release - Build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
platform: | |
- "linux/386" | |
- "linux/amd64" | |
- "linux/arm/v6" | |
- "linux/arm/v7" | |
- "linux/arm64/v8" | |
- "linux/riscv64" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set variables | |
id: set-variables | |
run: | | |
echo "DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_OUTPUT | |
echo "PLATFORM_NAME=${{ matrix.platform }}" | sed 's|/|-|g' >> $GITHUB_OUTPUT | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
if: (matrix.platform != 'linux/386') && (matrix.platform != 'linux/amd64') | |
with: | |
platforms: ${{ matrix.platform }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
buildkitd-config-inline: | | |
[worker.oci] | |
max-parallelism = 1 | |
- name: Build image | |
uses: docker/build-push-action@v6 | |
with: | |
build-args: | | |
QBT_VERSION=${{ env.QBT_VERSION }} | |
labels: | | |
org.opencontainers.image.authors=https://github.com/qbittorrent/qBittorrent/graphs/contributors | |
org.opencontainers.image.base.name=docker.io/alpine:latest | |
org.opencontainers.image.description=An advanced BitTorrent client programmed in C++, based on Qt toolkit and libtorrent-rasterbar | |
org.opencontainers.image.documentation=https://github.com/qbittorrent/docker-qbittorrent-nox#qbittorrent-nox-docker-image- | |
org.opencontainers.image.created=${{ steps.set-variables.outputs.DATE }} | |
org.opencontainers.image.licenses=GPL-3.0+ | |
org.opencontainers.image.ref.name=${{ env.QBT_VERSION }}-${{ env.TAG_RELEASE_NUMBER }} | |
org.opencontainers.image.revision=${{ github.sha }} | |
org.opencontainers.image.source=https://github.com/qbittorrent/docker-qbittorrent-nox | |
org.opencontainers.image.title=qbittorrent-nox docker image | |
org.opencontainers.image.url=https://github.com/qbittorrent/docker-qbittorrent-nox | |
org.opencontainers.image.vendor=qBittorrent | |
org.opencontainers.image.version=${{ env.QBT_VERSION }} | |
load: true | |
platforms: ${{ matrix.platform }} | |
tags: | | |
qbittorrentofficial/qbittorrent-nox:latest-${{ steps.set-variables.outputs.PLATFORM_NAME }} | |
ghcr.io/qbittorrent/docker-qbittorrent-nox:latest-${{ steps.set-variables.outputs.PLATFORM_NAME }} | |
- name: Test run | |
run: | | |
docker run \ | |
--entrypoint "/usr/bin/qbittorrent-nox" \ | |
--platform ${{ matrix.platform }} \ | |
qbittorrentofficial/qbittorrent-nox:latest-${{ steps.set-variables.outputs.PLATFORM_NAME }} \ | |
--version | |
# To run the image locally: | |
# 1. `docker load < artifact` | |
# 2. remove `build` field and replace `image` field with the imported image in docker-compose.yml | |
# 3. `docker compose up` | |
- name: Export image | |
run: | | |
docker tag \ | |
qbittorrentofficial/qbittorrent-nox:latest-${{ steps.set-variables.outputs.PLATFORM_NAME }} \ | |
qbittorrentofficial/qbittorrent-nox:${{ env.QBT_VERSION }} | |
docker save \ | |
--output qbittorrent-nox_${{ env.QBT_VERSION }}_${{ steps.set-variables.outputs.PLATFORM_NAME }} \ | |
qbittorrentofficial/qbittorrent-nox:${{ env.QBT_VERSION }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: qbittorrent-nox_${{ env.QBT_VERSION }}_${{ steps.set-variables.outputs.PLATFORM_NAME }} | |
path: qbittorrent-nox_${{ env.QBT_VERSION }}_${{ steps.set-variables.outputs.PLATFORM_NAME }} | |
- name: Generate build provenace attestations | |
uses: actions/attest-build-provenance@v1 | |
with: | |
subject-path: qbittorrent-nox_${{ env.QBT_VERSION }}_${{ steps.set-variables.outputs.PLATFORM_NAME }} | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Login to GitHub Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ github.token }} | |
- name: Upload to registries | |
run: | | |
docker push qbittorrentofficial/qbittorrent-nox:latest-${{ steps.set-variables.outputs.PLATFORM_NAME }} | |
docker push ghcr.io/qbittorrent/docker-qbittorrent-nox:latest-${{ steps.set-variables.outputs.PLATFORM_NAME }} | |
upload: | |
name: Release - Upload | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Login to GitHub Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ github.token }} | |
- name: Create multi-arch images | |
run: | | |
docker manifest create \ | |
qbittorrentofficial/qbittorrent-nox:${{ env.QBT_VERSION }}-${{ env.TAG_RELEASE_NUMBER }} \ | |
--amend qbittorrentofficial/qbittorrent-nox:latest-linux-386 \ | |
--amend qbittorrentofficial/qbittorrent-nox:latest-linux-amd64 \ | |
--amend qbittorrentofficial/qbittorrent-nox:latest-linux-arm-v6 \ | |
--amend qbittorrentofficial/qbittorrent-nox:latest-linux-arm-v7 \ | |
--amend qbittorrentofficial/qbittorrent-nox:latest-linux-arm64-v8 \ | |
--amend qbittorrentofficial/qbittorrent-nox:latest-linux-riscv64 | |
docker manifest create \ | |
qbittorrentofficial/qbittorrent-nox:latest \ | |
--amend qbittorrentofficial/qbittorrent-nox:latest-linux-386 \ | |
--amend qbittorrentofficial/qbittorrent-nox:latest-linux-amd64 \ | |
--amend qbittorrentofficial/qbittorrent-nox:latest-linux-arm-v6 \ | |
--amend qbittorrentofficial/qbittorrent-nox:latest-linux-arm-v7 \ | |
--amend qbittorrentofficial/qbittorrent-nox:latest-linux-arm64-v8 \ | |
--amend qbittorrentofficial/qbittorrent-nox:latest-linux-riscv64 | |
docker manifest create \ | |
ghcr.io/qbittorrent/docker-qbittorrent-nox:${{ env.QBT_VERSION }}-${{ env.TAG_RELEASE_NUMBER }} \ | |
--amend ghcr.io/qbittorrent/docker-qbittorrent-nox:latest-linux-386 \ | |
--amend ghcr.io/qbittorrent/docker-qbittorrent-nox:latest-linux-amd64 \ | |
--amend ghcr.io/qbittorrent/docker-qbittorrent-nox:latest-linux-arm-v6 \ | |
--amend ghcr.io/qbittorrent/docker-qbittorrent-nox:latest-linux-arm-v7 \ | |
--amend ghcr.io/qbittorrent/docker-qbittorrent-nox:latest-linux-arm64-v8 \ | |
--amend ghcr.io/qbittorrent/docker-qbittorrent-nox:latest-linux-riscv64 | |
docker manifest create \ | |
ghcr.io/qbittorrent/docker-qbittorrent-nox:latest \ | |
--amend ghcr.io/qbittorrent/docker-qbittorrent-nox:latest-linux-386 \ | |
--amend ghcr.io/qbittorrent/docker-qbittorrent-nox:latest-linux-amd64 \ | |
--amend ghcr.io/qbittorrent/docker-qbittorrent-nox:latest-linux-arm-v6 \ | |
--amend ghcr.io/qbittorrent/docker-qbittorrent-nox:latest-linux-arm-v7 \ | |
--amend ghcr.io/qbittorrent/docker-qbittorrent-nox:latest-linux-arm64-v8 \ | |
--amend ghcr.io/qbittorrent/docker-qbittorrent-nox:latest-linux-riscv64 | |
- name: Upload to registries | |
run: | | |
docker manifest push qbittorrentofficial/qbittorrent-nox:${{ env.QBT_VERSION }}-${{ env.TAG_RELEASE_NUMBER }} | |
docker manifest push qbittorrentofficial/qbittorrent-nox:latest | |
docker manifest push ghcr.io/qbittorrent/docker-qbittorrent-nox:${{ env.QBT_VERSION }}-${{ env.TAG_RELEASE_NUMBER }} | |
docker manifest push ghcr.io/qbittorrent/docker-qbittorrent-nox:latest | |
echo "::notice Remember to remove latest-* tags from Docker Hub!" |