Skip to content

Commit 0e97cf4

Browse files
committed
Update matrix_multi_build_and_release_qbt_workflow_files.yml
wokflows
1 parent ebddeea commit 0e97cf4

File tree

1 file changed

+79
-25
lines changed

1 file changed

+79
-25
lines changed

.github/workflows/matrix_multi_build_and_release_qbt_workflow_files.yml

Lines changed: 79 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
build:
11-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-22.04
1212
strategy:
1313
fail-fast: false
1414
matrix:
@@ -26,20 +26,14 @@ jobs:
2626
qbt_qt_version_name: ""
2727
qbt_qt_version: "6"
2828

29-
- libtorrent_version: "2.0"
30-
preview_release: false
31-
32-
- libtorrent_version: "1.2"
33-
preview_release: true
34-
3529
name: "${{ matrix.arch_type }}-${{ matrix.qbt_qt_version_name }}libtorrent-v${{ matrix.libtorrent_version }}"
3630

3731
env:
3832
build_dir: "qbt-build"
39-
name: "${{ matrix.arch_type }}-${{ matrix.qbt_qt_version_name }}libtorrent-v${{ matrix.libtorrent_version }}"
4033

4134
steps:
42-
- uses: actions/checkout@v3
35+
- name: Checkout ${{ github.event.inputs.distinct_id }}
36+
uses: actions/checkout@v3
4337

4438
- name: Host - update ${{ github.event.inputs.distinct_id }}
4539
run: sudo apt-get update
@@ -73,12 +67,6 @@ jobs:
7367
- name: Docker - Bootstrap ${{ github.event.inputs.distinct_id }}
7468
run: docker exec -w /root multiarch bash qbittorrent-nox-static.sh -bs-a
7569

76-
- name: Host - Bootstrap release tag ${{ github.event.inputs.distinct_id }}
77-
run: echo "release_tag=$(cat ${{ env.build_dir }}/release_info/tag.md)" >> $GITHUB_ENV
78-
79-
- name: Host - Bootstrap release title ${{ github.event.inputs.distinct_id }}
80-
run: echo "release_title=$(cat ${{ env.build_dir }}/release_info/title.md)" >> $GITHUB_ENV
81-
8270
- name: Docker - zlib-ng ${{ github.event.inputs.distinct_id }}
8371
run: docker exec -w /root multiarch bash qbittorrent-nox-static.sh zlib
8472

@@ -110,24 +98,90 @@ jobs:
11098
- name: Docker - qbittorrent ${{ github.event.inputs.distinct_id }}
11199
run: docker exec -w /root multiarch bash qbittorrent-nox-static.sh qbittorrent
112100

113-
- name: Docker - "Set release asset name" ${{ github.event.inputs.distinct_id }}
101+
- name: Docker - Set release asset name ${{ github.event.inputs.distinct_id }}
114102
run: docker exec -w /root/${{ env.build_dir }}/completed multiarch mv -f qbittorrent-nox ${{ matrix.arch_type }}-${{ matrix.qbt_qt_version_name }}qbittorrent-nox
115103

104+
- name: Docker - Release Info ${{ github.event.inputs.distinct_id }}
105+
run: docker exec -w /root/${{ env.build_dir }}/release_info multiarch bash -c 'mv *.md *.json '/root/${{ env.build_dir }}/completed''
106+
107+
- name: Host - Upload libtorrent-v${{ matrix.libtorrent_version }}-qbittorrent-nox and release info artifact ${{ github.event.inputs.distinct_id }}
108+
uses: actions/upload-artifact@v3
109+
with:
110+
name: libtorrent-v${{ matrix.libtorrent_version }}-${{ matrix.arch_type }}-${{ matrix.qbt_qt_version_name }}qbittorrent-nox
111+
path: |
112+
${{ env.build_dir }}/completed/*
113+
!${{ env.build_dir }}/completed/*.png
114+
115+
- name: Host - Upload cmake graphs artifact ${{ github.event.inputs.distinct_id }}
116+
if: matrix.build_tool == 'cmake'
117+
uses: actions/upload-artifact@v3
118+
with:
119+
name: "${{ matrix.arch_type }}-libtorrent-v${{ matrix.libtorrent_version }}-graphs"
120+
path: "${{ env.build_dir }}/completed/*.png"
121+
122+
release:
123+
runs-on: ubuntu-22.04
124+
needs: build
125+
if: always() && contains(needs.*.result, 'success') && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
126+
strategy:
127+
fail-fast: false
128+
matrix:
129+
libtorrent_version: ["1.2", "2.0"]
130+
include:
131+
- libtorrent_version: "2.0"
132+
preview_release: false
133+
134+
- libtorrent_version: "1.2"
135+
preview_release: true
136+
137+
name: "Publish release libtorrent-v${{ matrix.libtorrent_version }}"
138+
139+
env:
140+
build_dir: "qbt-build"
141+
142+
steps:
143+
- name: Checkout ${{ github.event.inputs.distinct_id }}
144+
uses: actions/checkout@v3
145+
146+
- name: Host - Download qbittorrent-nox artifacts ${{ github.event.inputs.distinct_id }}
147+
uses: actions/download-artifact@v3
148+
149+
- name: Host - 1.2 artifacts organise for release ${{ github.event.inputs.distinct_id }}
150+
run: |
151+
mkdir -p "1.2"
152+
for files in libtorrent-v1.2-*-qbittorrent-nox; do
153+
cp -rf ${files}/* "1.2/"
154+
done
155+
156+
- name: Host - 2.0 artifacts organise for release ${{ github.event.inputs.distinct_id }}
157+
run: |
158+
mkdir -p "2.0"
159+
for files in libtorrent-v2.0-*-qbittorrent-nox; do
160+
cp -rf ${files}/* "2.0/"
161+
done
162+
163+
- name: Host - merge release-info ${{ github.event.inputs.distinct_id }}
164+
if: matrix.libtorrent_version == '1.2'
165+
run: paste -d '\n' ${{ matrix.libtorrent_version }}/dependency-version.json 2.0/dependency-version.json | uniq > dependency-version.json
166+
167+
- name: Host - merge release-info ${{ github.event.inputs.distinct_id }}
168+
if: matrix.libtorrent_version == '2.0'
169+
run: paste -d '\n' 1.2/dependency-version.json ${{ matrix.libtorrent_version }}/dependency-version.json | uniq > dependency-version.json
170+
171+
- name: Host - Bootstrap release tag ${{ github.event.inputs.distinct_id }}
172+
run: echo "release_tag=$(cat ${{ matrix.libtorrent_version }}/tag.md)" >> $GITHUB_ENV
173+
174+
- name: Host - Bootstrap release title ${{ github.event.inputs.distinct_id }}
175+
run: echo "release_title=$(cat ${{ matrix.libtorrent_version }}/title.md)" >> $GITHUB_ENV
176+
116177
- name: Host- Create release - tag - assets ${{ github.event.inputs.distinct_id }}
117178
uses: ncipollo/[email protected]
118179
with:
119180
prerelease: "${{ matrix.preview_release }}"
120-
artifacts: "${{ env.build_dir }}/completed/${{ matrix.arch_type }}-${{ matrix.qbt_qt_version_name }}qbittorrent-nox,${{ env.build_dir }}/release_info/dependency-version.json"
181+
artifacts: "${{ matrix.libtorrent_version }}/*-qbittorrent-nox,dependency-version.json"
121182
replacesArtifacts: true
122183
tag: "${{ env.release_tag }}"
123184
name: "${{ env.release_title }}"
124-
bodyFile: "${{ env.build_dir }}/release_info/release.md"
185+
bodyFile: "${{ matrix.libtorrent_version }}/release.md"
125186
allowUpdates: true
126187
token: "${{ secrets.GITHUB_TOKEN }}"
127-
128-
- name: Archive code coverage results ${{ github.event.inputs.distinct_id }}
129-
if: matrix.build_tool == 'cmake'
130-
uses: actions/upload-artifact@v3
131-
with:
132-
name: "${{ env.name }}-graphs"
133-
path: "${{ env.build_dir }}/completed/*.png"

0 commit comments

Comments
 (0)