Skip to content

Commit a9483e7

Browse files
committed
add actions for debian
1 parent d17390c commit a9483e7

4 files changed

Lines changed: 114 additions & 6 deletions

File tree

.github/workflows/package.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ env:
77

88
jobs:
99
build:
10-
runs-on: ubuntu-22.04
10+
name: Build ${{matrix.os}}
11+
runs-on: ${{matrix.os}}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-22.04, ubuntu-24.04]
1115

1216
steps:
1317
- uses: actions/checkout@v4
@@ -41,5 +45,5 @@ jobs:
4145

4246
- uses: actions/upload-artifact@v4
4347
with:
44-
name: deb
48+
name: ${{matrix.os}}
4549
path: ${{github.workspace}}/build/*.deb

.github/workflows/pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
build:
1010
name: Publish Pages
11-
runs-on: ubuntu-22.04
11+
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout code
1414
uses: actions/checkout@v4

.github/workflows/release.yml

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ jobs:
2727
tag: ${{ steps.ref_name.outputs.SOURCE_TAG }}
2828
body: "libdict ${{ steps.ref_name.outputs.SOURCE_TAG }}"
2929

30-
build:
31-
name: Build Release ${{matrix.os}}
30+
ubuntu:
31+
name: Release ${{matrix.os}}
3232
needs: [release]
3333
runs-on: ${{matrix.os}}
34+
3435
strategy:
3536
matrix:
3637
os: [ubuntu-22.04, ubuntu-24.04]
@@ -86,3 +87,68 @@ jobs:
8687
file: build/libdict-${{ matrix.os }}.zip
8788
asset_name: libdict-${{ matrix.os }}.zip
8889
tag: ${{ steps.ref_name.outputs.SOURCE_TAG }}
90+
91+
debian:
92+
name: Release debian ${{matrix.os}}
93+
needs: [release]
94+
runs-on: ubuntu-latest
95+
container:
96+
image: debian:${{matrix.os}}
97+
volumes:
98+
- ${{github.workspace}}:${{github.workspace}}
99+
100+
strategy:
101+
matrix:
102+
os: [bookworm, trixie]
103+
104+
steps:
105+
- name: Checkout code
106+
uses: actions/checkout@v4
107+
108+
- name: Install dependencies
109+
shell: bash
110+
run: apt update && apt install build-essential cmake libcunit1-dev --yes
111+
112+
- name: Get Ref Names
113+
id: ref_name
114+
run: |
115+
echo "SOURCE_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
116+
echo "SOURCE_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
117+
echo "SOURCE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
118+
119+
- name: Set export SOURCE_DATE_EPOCH to git commit time
120+
run: |
121+
echo "SOURCE_DATE_EPOCH=$(git log -1 --format=%ct)" >> $GITHUB_ENV
122+
123+
- name: Create Build Environment
124+
run: cmake -E make_directory ${{github.workspace}}/build
125+
126+
- name: Configure CMake
127+
shell: bash
128+
working-directory: ${{github.workspace}}/build
129+
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DLIBDICT_VERSION=${{ steps.ref_name.outputs.SOURCE_TAG }}
130+
131+
- name: Build
132+
working-directory: ${{github.workspace}}/build
133+
shell: bash
134+
run: cmake --build . --config $BUILD_TYPE
135+
136+
- name: Test
137+
working-directory: ${{github.workspace}}/build
138+
shell: bash
139+
run: ctest -C $BUILD_TYPE
140+
141+
- name: Package
142+
working-directory: ${{github.workspace}}/build
143+
shell: bash
144+
run: |
145+
cpack -G DEB
146+
zip libdict-${{ matrix.os }}.zip *.deb
147+
148+
- name: Upload Release
149+
uses: svenstaro/upload-release-action@v2
150+
with:
151+
repo_token: ${{ secrets.GITHUB_TOKEN }}
152+
file: build/libdict-${{ matrix.os }}.zip
153+
asset_name: libdict-${{ matrix.os }}.zip
154+
tag: ${{ steps.ref_name.outputs.SOURCE_TAG }}

.github/workflows/test.yml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ env:
66
BUILD_TYPE: Debug
77

88
jobs:
9-
build:
9+
ubuntu:
10+
name: Test ${{matrix.os}}
1011
runs-on: ${{matrix.os}}
1112
strategy:
1213
matrix:
@@ -36,3 +37,40 @@ jobs:
3637
working-directory: ${{github.workspace}}/build
3738
shell: bash
3839
run: ctest -C $BUILD_TYPE
40+
41+
debian:
42+
name: Test debian ${{matrix.os}}
43+
runs-on: ubuntu-latest
44+
container:
45+
image: debian:${{matrix.os}}
46+
volumes:
47+
- ${{github.workspace}}:${{github.workspace}}
48+
49+
strategy:
50+
matrix:
51+
os: [bookworm, trixie]
52+
53+
steps:
54+
- uses: actions/checkout@v4
55+
56+
- name: Install dependencies
57+
shell: bash
58+
run: apt update && apt install build-essential cmake libcunit1-dev --yes
59+
60+
- name: Create Build Environment
61+
run: cmake -E make_directory ${{github.workspace}}/build
62+
63+
- name: Configure CMake
64+
shell: bash
65+
working-directory: ${{github.workspace}}/build
66+
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
67+
68+
- name: Build
69+
working-directory: ${{github.workspace}}/build
70+
shell: bash
71+
run: cmake --build . --config $BUILD_TYPE
72+
73+
- name: Test
74+
working-directory: ${{github.workspace}}/build
75+
shell: bash
76+
run: ctest -C $BUILD_TYPE

0 commit comments

Comments
 (0)