From 7791a7c0a39aca9a448b54af1623ec825b814480 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sat, 14 Jan 2023 02:58:17 +0800 Subject: [PATCH] Add CI to build alpha versions weekly --- .github/workflows/alpha.yaml | 105 +++++++++++++++++++++++++++++++++++ Readme.md | 3 +- 2 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/alpha.yaml diff --git a/.github/workflows/alpha.yaml b/.github/workflows/alpha.yaml new file mode 100644 index 0000000..8ac2fa0 --- /dev/null +++ b/.github/workflows/alpha.yaml @@ -0,0 +1,105 @@ +name: Release - Alpha + +on: + schedule: + - cron: '0 0 * * 0' + workflow_dispatch: # allow trigger it manually + +permissions: + packages: write + +jobs: + build: + name: Build + runs-on: ubuntu-latest + + strategy: + matrix: + platform: + - "linux/amd64" + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set platform name + id: set-platform-name + run: | + echo "PLATFORM_NAME=${{ matrix.platform }}" | sed 's|/|-|g' >> $GITHUB_OUTPUT + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: ${{ matrix.platform }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + with: + config-inline: | + [worker.oci] + max-parallelism = 1 + + - name: Build + uses: docker/build-push-action@v3 + with: + build-args: | + QBT_VERSION=devel + LIBBT_VERSION=devel + LIBBT_CMAKE_FLAGS=-Ddeprecated-functions=ON + load: true + platforms: ${{ matrix.platform }} + labels: | + 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 + org.opencontainers.image.licenses=GPL-3.0+ + 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=master + tags: | + qbittorrentofficial/qbittorrent-nox:alpha + ghcr.io/qbittorrent/docker-qbittorrent-nox:alpha + + - name: Test run + run: | + docker run \ + --entrypoint "/usr/bin/qbittorrent-nox" \ + --platform ${{ matrix.platform }} \ + qbittorrentofficial/qbittorrent-nox:alpha \ + --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 save \ + --output qbittorrent-nox_alpha_${{ steps.set-platform-name.outputs.PLATFORM_NAME }} \ + qbittorrentofficial/qbittorrent-nox:alpha + + - name: Upload build artifacts + uses: actions/upload-artifact@v3 + with: + name: qbittorrent-nox_alpha_${{ steps.set-platform-name.outputs.PLATFORM_NAME }} + path: qbittorrent-nox_alpha_${{ steps.set-platform-name.outputs.PLATFORM_NAME }} + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Login to GitHub Container registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ github.token }} + + - name: Upload to registries + run: | + docker push qbittorrentofficial/qbittorrent-nox:alpha + docker push ghcr.io/qbittorrent/docker-qbittorrent-nox:alpha diff --git a/Readme.md b/Readme.md index 68438e5..35f9fab 100644 --- a/Readme.md +++ b/Readme.md @@ -50,7 +50,8 @@ https://github.com/qbittorrent/qBittorrent/issues * `QBT_VERSION` \ This environment variable specifies the version of qBittorrent-nox to use. \ For example, `4.4.5-1` is a valid entry. You can find all tagged versions [here](https://hub.docker.com/r/qbittorrentofficial/qbittorrent-nox/tags). \ - Or you can put `latest` to use the latest stable release of qBittorrent. + Or you can put `latest` to use the latest stable release of qBittorrent. \ + If you are up to test the bleeding-edge version, you can put `alpha` to get the weekly build. * `QBT_WEBUI_PORT` \ This environment variable sets the port number which qBittorrent WebUI will be binded to.