Skip to content

Commit cbc5f1b

Browse files
committed
CI: add deepin.yml
1 parent 2085d4b commit cbc5f1b

2 files changed

Lines changed: 92 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ jobs:
1919
secrets: inherit
2020
if: false
2121

22+
deepin:
23+
uses: ./.github/workflows/deepin.yml
24+
secrets: inherit
25+
2226
aarch64:
2327
uses: ./.github/workflows/aarch64.yml
2428
secrets: inherit
@@ -73,7 +77,7 @@ jobs:
7377
deploy:
7478
#if: ${{ startsWith(github.ref, 'refs/tags/') }}
7579
runs-on: ubuntu-latest
76-
needs: [linux, docker, flatpak, msvc, doxygen, android, macos]
80+
needs: [linux, deepin, docker, flatpak, msvc, doxygen, android, macos]
7781
steps:
7882
- name: Checkout Repository
7983
uses: actions/checkout@v4
@@ -95,6 +99,13 @@ jobs:
9599
path: ${{ env.artifact_path }}
96100
merge-multiple: true
97101

102+
- name: Download deepin
103+
uses: actions/download-artifact@v4
104+
with:
105+
pattern: ${{ needs.deepin.outputs.name }}*
106+
path: ${{ env.artifact_path }}
107+
merge-multiple: true
108+
98109
- name: Download appimage
99110
uses: actions/download-artifact@v4
100111
if: false

.github/workflows/deepin.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Author: Kang Lin <kl222@126.com>
2+
3+
name: deepin
4+
5+
on:
6+
workflow_call:
7+
outputs:
8+
name:
9+
description: "The artifact name"
10+
value: ${{ jobs.build_deepin.outputs.name }}
11+
12+
env:
13+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
14+
15+
jobs:
16+
build_deepin:
17+
strategy:
18+
matrix:
19+
BUILD_TYPE: [Release]
20+
os: [ubuntu-24.04, ubuntu-24.04-arm]
21+
22+
# See: [About GitHub-hosted runners](https://docs.github.com/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners)
23+
# See: [Choosing the runner for a job](https://docs.github.com/actions/writing-workflows/choosing-where-your-workflow-runs/choosing-the-runner-for-a-job)
24+
# See: https://github.com/actions/runner-images/
25+
runs-on: ${{matrix.os}}
26+
container:
27+
# 使用 Deepin 23 官方基础镜像作为构建环境
28+
image: linuxdeepin/beige:latest
29+
# 赋予必要的权限,以便 apt 等工具正常工作
30+
options: --privileged
31+
32+
env:
33+
BUILD_TYPE: ${{matrix.BUILD_TYPE}}
34+
BUILD_DIR: ${{github.workspace}}/build
35+
SOURCE_DIR: ${{github.workspace}}/.cache/source
36+
TOOLS_DIR: ${{github.workspace}}/.cache/tools
37+
INSTALL_DIR: ${{github.workspace}}/.cache/install_${{matrix.os}}_${{matrix.BUILD_TYPE}}
38+
RabbitRemoteControl_VERSION: 0.1.0-dev
39+
artifact_name: build_deepin
40+
41+
# Map the job outputs to step outputs
42+
outputs:
43+
name: ${{ env.artifact_name }}
44+
45+
steps:
46+
- name: Checkout Repository
47+
uses: actions/checkout@v4
48+
with:
49+
submodules: true
50+
fetch-depth: 0
51+
52+
- name: Make directories
53+
run: |
54+
cmake -E make_directory ${{env.BUILD_DIR}}
55+
cmake -E make_directory ${{env.SOURCE_DIR}}
56+
cmake -E make_directory ${{env.TOOLS_DIR}}
57+
cmake -E make_directory ${{env.INSTALL_DIR}}
58+
59+
- name: Cache installed
60+
uses: actions/cache@v4
61+
id: cache-installed
62+
with:
63+
path: |
64+
${{env.INSTALL_DIR}}
65+
key: install_deepin_${{matrix.os}}
66+
67+
- name: build_linux.sh
68+
working-directory: ${{github.workspace}}
69+
run: |
70+
./Script/build_linux.sh --deb
71+
ARCH=`dpkg --print-architecture`
72+
cp ../rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_${ARCH}.deb rabbitremotecontrol_${{env.RabbitRemoteControl_VERSION}}_deepin_${ARCH}.deb
73+
74+
- name: Update artifact
75+
if: ${{ matrix.BUILD_TYPE == 'Release' }}
76+
uses: actions/upload-artifact@v4
77+
with:
78+
name: ${{ env.artifact_name }}_${{matrix.os}}
79+
path: |
80+
${{github.workspace}}/rabbitremotecontrol_*.deb

0 commit comments

Comments
 (0)