Skip to content

Commit 42323d5

Browse files
committed
workflows
1 parent 7c0ae10 commit 42323d5

23 files changed

+921
-1890
lines changed
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
# @credits https://github.com/c0re100/qBittorrent-Enhanced-Edition
2+
name: ci - alpine build
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
distinct_id:
8+
description: "Distinct id"
9+
required: false
10+
type: string
11+
workflow-files:
12+
description: "Alpine: workflow-files files"
13+
required: true
14+
type: string
15+
icu:
16+
description: "enable icu"
17+
required: true
18+
type: string
19+
debug:
20+
description: "debug builds"
21+
required: true
22+
type: string
23+
24+
jobs:
25+
build-alpine:
26+
runs-on: ubuntu-latest
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
os_id: [alpine]
31+
os_version_id: [edge]
32+
qbt_cross_name: ["armhf", "armv7", "aarch64", "x86_64", "x86"]
33+
qbt_libtorrent_version: ["1.2", "2.0"]
34+
qbt_build_tool: ["", "qmake"]
35+
include:
36+
- qbt_build_tool: "qmake"
37+
qbt_qt_version_name: "qt5-"
38+
qbt_qt_version: "5"
39+
- qbt_build_tool: ""
40+
qbt_qt_version_name: ""
41+
qbt_qt_version: "6"
42+
43+
name: "${{ matrix.qbt_cross_name }}-${{ matrix.qbt_qt_version_name }}libtorrent-v${{ matrix.qbt_libtorrent_version }}"
44+
45+
env:
46+
qbt_build_dir: "qbt-build"
47+
48+
steps:
49+
- name: Checkout ${{ inputs.distinct_id }}
50+
uses: actions/checkout@v4
51+
52+
- name: Host - phased updates ${{ inputs.distinct_id }}
53+
run: printf '%s\n' 'APT::Get::Always-Include-Phased-Updates "false";' | sudo tee /etc/apt/apt.conf.d/99-phased-updates
54+
55+
- name: Host - update ${{ inputs.distinct_id }}
56+
run: sudo apt-get update
57+
58+
- name: Host - upgrade ${{ inputs.distinct_id }}
59+
run: sudo apt-get -y upgrade
60+
61+
- name: Host - set up qemu-user-static binfmt-support ${{ inputs.distinct_id }}
62+
run: sudo apt install libpipeline1 qemu-user-static binfmt-support
63+
64+
- name: Host - Create Docker template env file ${{ inputs.distinct_id }}
65+
run: |
66+
printf '%s\n' "qbt_build_dir=${{ env.qbt_build_dir }}" > env.custom
67+
printf '%s\n' "qbt_libtorrent_version=${{ matrix.qbt_libtorrent_version }}" >> env.custom
68+
printf '%s\n' "qbt_qt_version=${{ matrix.qbt_qt_version }}" >> env.custom
69+
printf '%s\n' "qbt_build_tool=${{ matrix.qbt_build_tool }}" >> env.custom
70+
printf '%s\n' "qbt_cross_name=${{ matrix.qbt_cross_name }}" >> env.custom
71+
printf '%s\n' "qbt_patches_url=${{ github.repository }}" >> env.custom
72+
printf '%s\n' "qbt_skip_icu=${{ inputs.icu }}" >> env.custom
73+
printf '%s\n' "qbt_boost_tag=" >> env.custom
74+
printf '%s\n' "qbt_libtorrent_tag=" >> env.custom
75+
printf '%s\n' "qbt_qt_tag=" >> env.custom
76+
printf '%s\n' "qbt_qbittorrent_tag=" >> env.custom
77+
printf '%s\n' "qbt_libtorrent_master_jamfile=" >> env.custom
78+
printf '%s\n' "qbt_workflow_files=${{ inputs.workflow-files }}" >> env.custom
79+
printf '%s\n' "qbt_workflow_artifacts=" >> env.custom
80+
printf '%s\n' "qbt_cache_dir=" >> env.custom
81+
printf '%s\n' "qbt_optimise_strip=${{ inputs.debug }}" >> env.custom
82+
printf '%s\n' "qbt_build_debug=${{ inputs.debug }}" >> env.custom
83+
printf '%s\n' "qbt_revision_url=${{ github.repository }}" >> env.custom
84+
printf '%s\n' "qbt_standard=" >> env.custom
85+
printf '%s\n' "qbt_static_ish=" >> env.custom
86+
87+
- name: Host - Create docker multiarch container ${{ inputs.distinct_id }}
88+
run: docker run --name multiarch -it -d --env-file env.custom -w /root -v ${{ github.workspace }}:/root ${{ matrix.os_id }}:${{ matrix.os_version_id }}
89+
90+
- name: Docker - apk update ${{ inputs.distinct_id }}
91+
run: docker exec -w /root multiarch apk update
92+
93+
- name: Docker - apk install bash ${{ inputs.distinct_id }}
94+
run: docker exec -w /root multiarch apk add bash
95+
96+
- name: Docker - Bootstrap ${{ inputs.distinct_id }}
97+
run: docker exec -w /root multiarch bash qbittorrent-nox-static.sh -bs-a
98+
99+
- name: Host - qBittorrent v5 transition ${{ inputs.distinct_id }}
100+
run: |
101+
if [[ -f "${{ env.qbt_build_dir }}/release_info/disable-qt5" ]]; then
102+
printf '%s\n' "disable_qt5=yes" >> $GITHUB_ENV
103+
fi
104+
105+
- name: Docker - Copy repo patches to build folder ${{ inputs.distinct_id }}
106+
if: env.disable_qt5 != 'yes'
107+
run: if [[ -d patches ]]; then docker exec -w /root multiarch cp -r patches/* /root/${{ env.qbt_build_dir }}/patches; fi
108+
109+
- name: Docker - zlib-ng ${{ inputs.distinct_id }}
110+
if: env.disable_qt5 != 'yes'
111+
run: docker exec -w /root multiarch bash qbittorrent-nox-static.sh zlib
112+
113+
- name: Docker - iconv ${{ inputs.distinct_id }}
114+
if: env.disable_qt5 != 'yes'
115+
run: docker exec -w /root multiarch bash qbittorrent-nox-static.sh iconv
116+
117+
- name: Docker - icu ${{ inputs.distinct_id }}
118+
if: env.disable_qt5 != 'yes'
119+
run: docker exec -w /root multiarch bash qbittorrent-nox-static.sh icu
120+
121+
- name: Docker - openssl ${{ inputs.distinct_id }}
122+
if: env.disable_qt5 != 'yes'
123+
run: docker exec -w /root multiarch bash qbittorrent-nox-static.sh openssl
124+
125+
- name: Docker - boost ${{ inputs.distinct_id }}
126+
if: env.disable_qt5 != 'yes'
127+
run: docker exec -w /root multiarch bash qbittorrent-nox-static.sh boost
128+
129+
- name: Docker - libtorrent ${{ inputs.distinct_id }}
130+
if: env.disable_qt5 != 'yes'
131+
run: docker exec -w /root multiarch bash qbittorrent-nox-static.sh libtorrent
132+
133+
- name: Docker - double_conversion ${{ inputs.distinct_id }}
134+
if: matrix.qbt_build_tool == '' && env.disable_qt5 != 'yes'
135+
run: docker exec -w /root multiarch bash qbittorrent-nox-static.sh double_conversion
136+
137+
- name: Docker - qtbase ${{ inputs.distinct_id }}
138+
if: env.disable_qt5 != 'yes'
139+
run: docker exec -w /root multiarch bash qbittorrent-nox-static.sh qtbase
140+
141+
- name: Docker - qttools ${{ inputs.distinct_id }}
142+
if: env.disable_qt5 != 'yes'
143+
run: docker exec -w /root multiarch bash qbittorrent-nox-static.sh qttools
144+
145+
- name: Docker - qbittorrent ${{ inputs.distinct_id }}
146+
if: env.disable_qt5 != 'yes'
147+
run: docker exec -w /root multiarch bash qbittorrent-nox-static.sh qbittorrent
148+
149+
- name: Docker - Set release asset name ${{ inputs.distinct_id }}
150+
if: env.disable_qt5 != 'yes'
151+
run: docker exec -w /root/${{ env.qbt_build_dir }}/completed multiarch mv -f qbittorrent-nox ${{ matrix.qbt_cross_name }}-${{ matrix.qbt_qt_version_name }}qbittorrent-nox
152+
153+
- name: Generate artifact attestation ${{ inputs.distinct_id }}
154+
if: env.disable_qt5 != 'yes'
155+
uses: actions/attest-build-provenance@v2
156+
with:
157+
subject-path: "${{ env.qbt_build_dir }}/completed/${{ matrix.qbt_cross_name }}-${{ matrix.qbt_qt_version_name }}qbittorrent-nox"
158+
159+
- name: Docker - Release Info ${{ inputs.distinct_id }}
160+
if: env.disable_qt5 != 'yes'
161+
run: docker exec -w /root/${{ env.qbt_build_dir }}/release_info multiarch bash -c 'mv *.md *.json '/root/${{ env.qbt_build_dir }}/completed''
162+
163+
- name: Host - Upload libtorrent-v${{ matrix.qbt_libtorrent_version }}-qbittorrent-nox and release info artifact ${{ inputs.distinct_id }}
164+
if: env.disable_qt5 != 'yes'
165+
uses: actions/upload-artifact@v4
166+
with:
167+
name: libtorrent-v${{ matrix.qbt_libtorrent_version }}-${{ matrix.qbt_cross_name }}-${{ matrix.qbt_qt_version_name }}qbittorrent-nox
168+
path: |
169+
${{ env.qbt_build_dir }}/completed/*
170+
!${{ env.qbt_build_dir }}/completed/*.png
171+
172+
- name: Host - Upload cmake graphs artifact ${{ inputs.distinct_id }}
173+
if: matrix.qbt_build_tool == '' && env.disable_qt5 != 'yes'
174+
uses: actions/upload-artifact@v4
175+
with:
176+
name: "${{ matrix.qbt_cross_name }}-libtorrent-v${{ matrix.qbt_libtorrent_version }}-graphs"
177+
path: "${{ env.qbt_build_dir }}/completed/*.png"
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: ci - alpine-release
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
distinct_id:
7+
description: "Distinct ID for the artifacts"
8+
required: true
9+
type: string
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
qbt_libtorrent_version: ["1.2", "2.0"]
18+
include:
19+
- qbt_libtorrent_version: "1.2"
20+
preview_release: true
21+
22+
- qbt_libtorrent_version: "2.0"
23+
preview_release: false
24+
25+
name: "Publish release libtorrent-v${{ matrix.qbt_libtorrent_version }}"
26+
27+
env:
28+
qbt_build_dir: "qbt-build"
29+
30+
steps:
31+
- name: Checkout ${{ inputs.distinct_id }}
32+
uses: actions/checkout@v4
33+
34+
- name: Pandoc - Bootstrap
35+
run: |
36+
pandoc_git_tag="$(git ls-remote -q -t --refs https://github.com/jgm/pandoc.git | awk '/tags\/[0-9]/{sub("refs/tags/", ""); print $2 }' | awk '!/^$/' | sort -rV | head -n 1)"
37+
curl -sLo- "https://github.com/jgm/pandoc/releases/latest/download/pandoc-${pandoc_git_tag}-linux-amd64.tar.gz" | tar xzf - --strip-components 2 -C "$(pwd)" --exclude="share"
38+
39+
- name: Host - Download 1.2 qbittorrent-nox artifacts ${{ inputs.distinct_id }}
40+
uses: actions/download-artifact@v4
41+
with:
42+
path: "1.2"
43+
pattern: libtorrent-v1.2-*-qbittorrent-nox
44+
merge-multiple: true
45+
46+
- name: Host - Download 2.0 qbittorrent-nox artifacts ${{ inputs.distinct_id }}
47+
uses: actions/download-artifact@v4
48+
with:
49+
path: "2.0"
50+
pattern: libtorrent-v2.0-*-qbittorrent-nox
51+
merge-multiple: true
52+
53+
- name: Host - merge release-info ${{ inputs.distinct_id }}
54+
run: |
55+
if [[ ${{ matrix.qbt_libtorrent_version }} == "1.2" ]]; then
56+
for release in 1\.2/*-release.md; do
57+
[[ -f "${release}" ]] && release+=("${release}")
58+
done
59+
revision="$(jq -r .revision 1\.2/*-dependency-version.json | head -n1)"
60+
boost="$(jq -r .boost 1\.2/*-dependency-version.json | head -n1)"
61+
fi
62+
63+
if [[ ${{ matrix.qbt_libtorrent_version }} == "2.0" ]]; then
64+
for release in 2\.0/*-release.md; do
65+
[[ -f "${release}" ]] && release+=("${release}")
66+
done
67+
revision="$(jq -r .revision 2\.0/*-dependency-version.json | head -n1)"
68+
boost="$(jq -r .boost 2\.0/*-dependency-version.json | head -n1)"
69+
fi
70+
71+
readarray -t release_sorted < <(printf '%s\n' "${release[@]}" | sort)
72+
73+
for dependency_version_files in 1\.2/*-dependency-version.json 2\.0/*-dependency-version.json; do
74+
if [[ -f "${dependency_version_files}" ]]; then
75+
sed -r 's/"boost": (.*)/BOOST_PLACEHOLDER/g' -i "${dependency_version_files}"
76+
sed -r 's/"revision": (.*)/REVISION_PLACEHOLDER/g' -i "${dependency_version_files}"
77+
dependency_version+=("${dependency_version_files}")
78+
fi
79+
done
80+
81+
readarray -t dependency_version_sorted < <(printf '%s\n' "${dependency_version[@]}" | sort)
82+
83+
paste -d '\n' "${release_sorted[@]}" | uniq | awk '!(NF && seen[$0]++) || /^>/' > "tmp-release.md"
84+
paste -d '\n' "${dependency_version_sorted[@]}" | uniq | awk '!(NF && seen[$0]++)' > "dependency-version.json"
85+
86+
sed -i "s|BOOST_PLACEHOLDER|\"boost\": \"${boost}\",|" dependency-version.json
87+
sed -i "s|REVISION_PLACEHOLDER|\"revision\": \"${revision}\"|" dependency-version.json
88+
89+
./pandoc --wrap=preserve -f gfm tmp-release.md -t gfm -o release.md
90+
91+
- name: Host - Bootstrap release tag ${{ inputs.distinct_id }}
92+
run: printf '%s\n' "release_tag=$(cat ${{ matrix.qbt_libtorrent_version }}/tag.md)" >> $GITHUB_ENV
93+
94+
- name: Host - Bootstrap release title ${{ inputs.distinct_id }}
95+
run: printf '%s\n' "release_title=$(cat ${{ matrix.qbt_libtorrent_version }}/title.md)" >> $GITHUB_ENV
96+
97+
- name: Host- Create release - tag - assets ${{ inputs.distinct_id }}
98+
uses: ncipollo/release-action@v1
99+
with:
100+
prerelease: "${{ matrix.preview_release }}"
101+
artifacts: "${{ matrix.qbt_libtorrent_version }}/*-qbittorrent-nox,dependency-version.json"
102+
replacesArtifacts: true
103+
tag: "${{ env.release_tag }}"
104+
name: "${{ env.release_title }}"
105+
bodyFile: "release.md"
106+
allowUpdates: true
107+
token: "${{ github.TOKEN }}"

.github/workflows/rerun.yml renamed to .github/workflows/ci-auto-rerun-failed-jobs.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: rerun failed jobs with gh cli
1+
name: ci - auto rerun failed jobs with gh cli
22

33
on:
44
workflow_dispatch:
@@ -16,8 +16,6 @@ on:
1616
jobs:
1717
gh-cli-rerun:
1818
name: rerun - attempt ${{ inputs.attempts }}
19-
permissions:
20-
actions: write
2119
runs-on: ubuntu-latest
2220
env:
2321
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

0 commit comments

Comments
 (0)