Skip to content

Commit

Permalink
Revise CI scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocobo1 committed Dec 21, 2023
1 parent 9f62b29 commit 6763310
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 36 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/alpha.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set platform name
id: set-platform-name
- 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 Docker Buildx
Expand All @@ -34,25 +35,31 @@ jobs:
[worker.oci]
max-parallelism = 1
- name: Build
- name: Build image
uses: docker/build-push-action@v5
with:
build-args: |
QBT_VERSION=devel
LIBBT_VERSION=devel
LIBBT_CMAKE_FLAGS=-Ddeprecated-functions=ON
load: true
platforms: ${{ matrix.platform }}
cache-from: type=gha
cache-to: type=gha,mode=max
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
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=alpha-devel
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
load: true
platforms: ${{ matrix.platform }}
tags: |
qbittorrentofficial/qbittorrent-nox:alpha
ghcr.io/qbittorrent/docker-qbittorrent-nox:alpha
Expand All @@ -72,14 +79,14 @@ jobs:
- name: Export image
run: |
docker save \
--output qbittorrent-nox_alpha_${{ steps.set-platform-name.outputs.PLATFORM_NAME }} \
--output qbittorrent-nox_alpha_${{ steps.set-variables.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: qbittorrent-nox_alpha_${{ steps.set-variables.outputs.PLATFORM_NAME }}
path: qbittorrent-nox_alpha_${{ steps.set-variables.outputs.PLATFORM_NAME }}

- name: Login to Docker Hub
uses: docker/login-action@v3
Expand Down
31 changes: 19 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set platform name
id: set-platform-name
- 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 Docker Buildx
Expand All @@ -34,32 +35,38 @@ jobs:
[worker.oci]
max-parallelism = 1
- name: Build
- name: Build image
uses: docker/build-push-action@v5
with:
build-args: |
QBT_VERSION=devel
load: true
platforms: ${{ matrix.platform }}
cache-from: type=gha
cache-to: type=gha,mode=max
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
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=CI-devel
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
load: true
platforms: ${{ matrix.platform }}
tags: |
qbittorrent-nox_${{ steps.set-platform-name.outputs.PLATFORM_NAME }}:devel
qbittorrent-nox_${{ steps.set-variables.outputs.PLATFORM_NAME }}:devel
- name: Test run
run: |
docker run \
--entrypoint "/usr/bin/qbittorrent-nox" \
--platform ${{ matrix.platform }} \
qbittorrent-nox_${{ steps.set-platform-name.outputs.PLATFORM_NAME }}:devel \
qbittorrent-nox_${{ steps.set-variables.outputs.PLATFORM_NAME }}:devel \
--version
# To run the image locally:
Expand All @@ -69,11 +76,11 @@ jobs:
- name: Export image
run: |
docker save \
--output qbittorrent-nox_devel_${{ steps.set-platform-name.outputs.PLATFORM_NAME }} \
qbittorrent-nox_${{ steps.set-platform-name.outputs.PLATFORM_NAME }}:devel
--output qbittorrent-nox_devel_${{ steps.set-variables.outputs.PLATFORM_NAME }} \
qbittorrent-nox_${{ steps.set-variables.outputs.PLATFORM_NAME }}:devel
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: qbittorrent-nox_devel_${{ steps.set-platform-name.outputs.PLATFORM_NAME }}
path: qbittorrent-nox_devel_${{ steps.set-platform-name.outputs.PLATFORM_NAME }}
name: qbittorrent-nox_devel_${{ steps.set-variables.outputs.PLATFORM_NAME }}
path: qbittorrent-nox_devel_${{ steps.set-variables.outputs.PLATFORM_NAME }}
37 changes: 22 additions & 15 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set platform name
id: set-platform-name
- 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
Expand All @@ -49,33 +50,39 @@ jobs:
[worker.oci]
max-parallelism = 1
- name: Build and push
- name: Build image
uses: docker/build-push-action@v5
with:
build-args: |
QBT_VERSION=${{ env.QBT_VERSION }}
load: true
platforms: ${{ matrix.platform }}
cache-from: type=gha
cache-to: type=gha,mode=max
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
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-platform-name.outputs.PLATFORM_NAME }}
ghcr.io/qbittorrent/docker-qbittorrent-nox:latest-${{ steps.set-platform-name.outputs.PLATFORM_NAME }}
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-platform-name.outputs.PLATFORM_NAME }} \
qbittorrentofficial/qbittorrent-nox:latest-${{ steps.set-variables.outputs.PLATFORM_NAME }} \
--version
# To run the image locally:
Expand All @@ -85,17 +92,17 @@ jobs:
- name: Export image
run: |
docker tag \
qbittorrentofficial/qbittorrent-nox:latest-${{ steps.set-platform-name.outputs.PLATFORM_NAME }} \
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-platform-name.outputs.PLATFORM_NAME }} \
--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@v3
with:
name: qbittorrent-nox_${{ env.QBT_VERSION }}_${{ steps.set-platform-name.outputs.PLATFORM_NAME }}
path: qbittorrent-nox_${{ env.QBT_VERSION }}_${{ steps.set-platform-name.outputs.PLATFORM_NAME }}
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: Login to Docker Hub
uses: docker/login-action@v3
Expand All @@ -112,8 +119,8 @@ jobs:

- name: Upload to registries
run: |
docker push qbittorrentofficial/qbittorrent-nox:latest-${{ steps.set-platform-name.outputs.PLATFORM_NAME }}
docker push ghcr.io/qbittorrent/docker-qbittorrent-nox:latest-${{ steps.set-platform-name.outputs.PLATFORM_NAME }}
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:
Expand Down

0 comments on commit 6763310

Please sign in to comment.