-
-
Notifications
You must be signed in to change notification settings - Fork 41
130 lines (114 loc) · 4.71 KB
/
alpha.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Release - Alpha
on:
schedule:
- cron: '0 0 * * 0'
workflow_dispatch: # allow trigger it manually
permissions: {}
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
attestations: write
id-token: write
packages: write
strategy:
matrix:
platform:
- "linux/amd64"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- 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
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=devel
LIBBT_VERSION=RC_2_0
LIBBT_CMAKE_FLAGS=-Ddeprecated-functions=ON
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=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
- 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-variables.outputs.PLATFORM_NAME }} \
qbittorrentofficial/qbittorrent-nox:alpha
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: qbittorrent-nox_alpha_${{ steps.set-variables.outputs.PLATFORM_NAME }}
path: qbittorrent-nox_alpha_${{ steps.set-variables.outputs.PLATFORM_NAME }}
- name: Generate build provenace attestations
uses: actions/attest-build-provenance@v2
with:
subject-path: qbittorrent-nox_alpha_${{ steps.set-variables.outputs.PLATFORM_NAME }}
- name: Delete alpha tag
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
response=$(gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/orgs/qbittorrent/packages/container/docker-qbittorrent-nox/versions)
id=$(echo "$response" | jq 'map(select(.metadata.container.tags | . == ["alpha"]) | .id) | first')
gh api \
--method DELETE \
-H "X-GitHub-Api-Version: 2022-11-28" \
"/orgs/qbittorrent/packages/container/docker-qbittorrent-nox/versions/$id" \
|| true
- 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:alpha
docker push ghcr.io/qbittorrent/docker-qbittorrent-nox:alpha