-
Notifications
You must be signed in to change notification settings - Fork 3
185 lines (174 loc) · 4.74 KB
/
Copy pathdebian-package-packager.yml
File metadata and controls
185 lines (174 loc) · 4.74 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
name: Debian Package Packager workflow (build deb package)
on:
push:
paths-ignore:
- 'LICENSE'
- 'README.*'
pull_request:
paths-ignore:
- 'LICENSE'
- 'README.*'
jobs:
test-script:
runs-on: ubuntu-latest
strategy:
matrix:
desc:
- 'test package'
- ''
steps:
- uses: actions/checkout@v2
- run: |
mkdir -p .debpkg/usr/bin
mkdir -p .debpkg/usr/lib/testbin
echo -e "echo hello" > .debpkg/usr/bin/testbin
echo -e "echo hello2" > .debpkg/usr/bin/testbin2
echo -e "a=1" > .debpkg/usr/lib/testbin/testbin.conf
chmod +x .debpkg/usr/bin/*
- uses: ./
with:
package: testbin
package_root: .debpkg
maintainer: jiro4989
version: 'v1.0.0'
arch: 'amd64'
desc: "${{ matrix.desc }}"
if: matrix.desc != ''
- uses: ./
with:
package: testbin
package_root: .debpkg
maintainer: jiro4989
version: 'v1.0.0'
arch: 'amd64'
if: matrix.desc == ''
- name: install deb package
run: sudo dpkg -i *.deb
- name: check files
run: |
which testbin
testbin
which testbin2
testbin2
find /usr/lib/testbin/
cat /usr/lib/testbin/testbin.conf
test-github-ref-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
mkdir -p .debpkg/usr/bin
mkdir -p .debpkg/usr/lib/testbin
echo -e "echo hello" > .debpkg/usr/bin/testbin
echo -e "echo hello2" > .debpkg/usr/bin/testbin2
echo -e "a=1" > .debpkg/usr/lib/testbin/testbin.conf
chmod +x .debpkg/usr/bin/*
- uses: ./
with:
package: testbin
package_root: .debpkg
maintainer: jiro4989
version: 'refs/tags/v1.0.0'
arch: 'amd64'
desc: 'test package'
- name: install deb package
run: sudo dpkg -i *.deb
- name: check files
run: |
which testbin
testbin
which testbin2
testbin2
find /usr/lib/testbin/
cat /usr/lib/testbin/testbin.conf
test-nim-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: jiro4989/setup-nim-action@v1
- run: |
git clone https://github.com/jiro4989/nimjson app
(
cd app
nimble build -Y
cp bin/nimjson ../
)
rm -rf app
mkdir -p .debpkg/usr/bin
mv nimjson .debpkg/usr/bin/
- uses: ./
with:
package: nimjson
package_root: .debpkg
maintainer: jiro4989
version: 'v1.0.0'
arch: 'amd64'
desc: 'test package'
- run: sudo dpkg -i *.deb
- run: which nimjson
- run: nimjson -h
- run: dpkg -s nimjson
test-postinst:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
mkdir -p .debpkg/usr/bin
mkdir -p .debpkg/usr/lib/testbin
echo -e "echo hello" > .debpkg/usr/bin/testbin
echo -e "echo hello2" > .debpkg/usr/bin/testbin2
echo -e "a=1" > .debpkg/usr/lib/testbin/testbin.conf
mkdir -p .debpkg/DEBIAN
cat << E > .debpkg/DEBIAN/postinst
#!/bin/bash
set -eu
echo postinst $@
E
chmod +x .debpkg/DEBIAN/postinst
chmod +x .debpkg/usr/bin/*
- uses: ./
with:
package: testbin
package_root: .debpkg
maintainer: jiro4989
version: 'v1.0.0'
arch: 'amd64'
desc: 'test package'
- name: install deb package
run: sudo dpkg -i *.deb
- name: check files
run: |
which testbin
testbin
which testbin2
testbin2
find /usr/lib/testbin/
cat /usr/lib/testbin/testbin.conf
test-depends:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: jiro4989/setup-nim-action@v1
- run: |
git clone https://github.com/jiro4989/nimjson app
(
cd app
nimble build -Y
cp bin/nimjson ../
)
rm -rf app
mkdir -p .debpkg/usr/bin
mv nimjson .debpkg/usr/bin/
- uses: ./
with:
package: nimjson
package_root: .debpkg
maintainer: jiro4989
version: 'v1.0.0'
depends: 'libc6 (>= 2.2.1), git'
arch: 'amd64'
desc: 'test package'
- run: sudo dpkg -i *.deb
- run: which nimjson
- run: nimjson -h
- run: dpkg -s nimjson