-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (93 loc) · 2.55 KB
/
mclip.yml
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
---
name: mclip
on: push
permissions:
contents: write
jobs:
# Lint
cppcheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install
run: sudo apt install -y cppcheck
- name: Cppcheck
run: cppcheck ${GITHUB_WORKSPACE}/src/*.c
cpplint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install
run: sudo apt install -y cpplint
- name: Cpplint
run: cpplint ${GITHUB_WORKSPACE}/src/*.c
# Build
build:
needs: [cppcheck, cpplint]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Autoreconf
run: autoreconf --install
- name: Configure
run: ./configure
- name: Make
run: make
- name: Make dist
run: make dist
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: binary
path: src/mclip
if-no-files-found: error
- name: Upload source archive
uses: actions/upload-artifact@v3
with:
name: source-archive
path: mclip-*.tar.gz
if-no-files-found: error
# Package - Debian
package-debian:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download source-archive
uses: actions/download-artifact@v3
with:
name: source-archive
- name: Debian package
run: |
sudo apt-get install -y devscripts debhelper
mkdir -p "${RUNNER_TEMP}/debian-packaging"
cp mclip-*.tar.gz "${RUNNER_TEMP}/debian-packaging"
cd "${RUNNER_TEMP}/debian-packaging"
ORIG_TAR_GZ=$(ls mclip-*.gz | sed -E 's/^mclip-([[:digit:]])\.([[:digit:]])\.([[:digit:]])\.tar\.gz$/mclip_\1.\2.\3\.orig\.tar\.gz/g')
mv mclip-*.tar.gz "${ORIG_TAR_GZ}"
tar xf "${ORIG_TAR_GZ}"
cd mclip-*/
cp -R "${GITHUB_WORKSPACE}/debian" .
debuild -us -uc
cd ..
- name: Upload debian package
uses: actions/upload-artifact@v3
with:
name: debian-amd64-package
path: mclip_*_amd64.deb
if-no-files-found: error
# Release
release:
needs: [package-debian]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Release
uses: cycjimmy/semantic-release-action@v4
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}