-
Notifications
You must be signed in to change notification settings - Fork 7
149 lines (140 loc) · 4.77 KB
/
debian.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
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
name: Debian
on:
push:
branches:
- devel
tags:
- '**'
pull_request:
concurrency:
group: ${{ github.ref_name }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
source:
runs-on: ubuntu-latest
outputs:
project-name: ${{ steps.project-details.outputs.project-name }}
project-version: ${{ steps.project-details.outputs.project-version }}
project-source: ${{ steps.project-details.outputs.project-source }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- run: make sdist
- uses: actions/upload-artifact@v4
with:
name: upstream-source
path: dist/
- uses: actions/upload-artifact@v4
with:
name: upstream-debian-source
path: debian/
- id: project-details
run: |
echo project-name=bley >> $GITHUB_OUTPUT
echo project-version=$(python3 setup.py --version) >> $GITHUB_OUTPUT
echo project-source=bley-$(python3 setup.py --version).tar.gz >> $GITHUB_OUTPUT
debian-source:
needs: source
runs-on: ubuntu-latest
container: debian/buildd:bullseye
outputs:
project-name: ${{ needs.source.outputs.project-name }}
project-version: ${{ needs.source.outputs.project-version }}
steps:
- uses: actions/download-artifact@v4
with:
name: upstream-source
- run: echo PROJECT_ORIG_TAR=${{ needs.source.outputs.project-name }}_${{ needs.source.outputs.project-version }}.orig.tar.$(echo '${{ needs.source.outputs.project-source }}' | sed -E 's/.*\.tar\.([^.]+)$/\1/') >> $GITHUB_ENV
- run: mv ${{ needs.source.outputs.project-source }} ${{ env.PROJECT_ORIG_TAR }}
- run: tar --strip-components=1 --one-top-level=source -xf ${{ env.PROJECT_ORIG_TAR }}
- uses: actions/download-artifact@v4
with:
name: upstream-debian-source
path: source/debian/
- run: apt-get update
- run: apt-get install -y --no-install-recommends devscripts
- run: apt-get build-dep -y .
working-directory: source
- run: dch --newversion ${{ needs.source.outputs.project-version }}-1+gha+$(date +"%Y%m%d%H%M%S")+$(echo -n ${GITHUB_HEAD_REF:-$GITHUB_REF_NAME} | tr --complement '[:alnum:].' .) --preserve --force-bad-version "GitHub Actions build"
working-directory: source
env:
DEBEMAIL: [email protected]
DEBFULLNAME: GitHub Actions
- run: dpkg-buildpackage -us -uc -S
working-directory: source
- uses: actions/upload-artifact@v4
with:
name: debian-source
path: ${{ needs.source.outputs.project-name }}_${{ needs.source.outputs.project-version }}*
debian-binary:
needs: debian-source
runs-on: ubuntu-latest
container: debian/buildd:bullseye
steps:
- uses: actions/download-artifact@v4
with:
name: debian-source
- run: apt-get update
- run: dpkg-source -x *.dsc source
- run: apt-get build-dep -y .
working-directory: source
- run: dpkg-buildpackage -us -uc
working-directory: source
- uses: actions/upload-artifact@v4
with:
name: debian-binary
path: |
${{ needs.debian-source.outputs.project-name }}_${{ needs.debian-source.outputs.project-version }}*
*.deb
!*_source.*
lintian:
runs-on: ubuntu-latest
needs: debian-binary
steps:
- uses: actions/download-artifact@v4
with:
name: debian-binary
- uses: evgeni/action-lintian@v0
autopkgtest:
runs-on: ubuntu-latest
needs: debian-binary
steps:
- uses: actions/download-artifact@v4
with:
name: debian-binary
- uses: evgeni/action-autopkgtest@v0
piuparts:
runs-on: ubuntu-latest
needs: debian-binary
steps:
- uses: actions/download-artifact@v4
with:
name: debian-binary
- uses: evgeni/action-piuparts@v0
with:
fake-essential-packages: dbconfig-no-thanks
cloudsmith:
if: github.repository_owner == 'evgeni' && github.event_name == 'push'
runs-on: ubuntu-latest
needs:
- debian-binary
- lintian
- autopkgtest
- piuparts
steps:
- uses: actions/download-artifact@v4
with:
name: debian-binary
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- run: pip install cloudsmith-cli
- run: |
cloudsmith push deb --changes-file *.debian.tar.* --sources-file *.orig.tar.* bley/bley/debian/sid *.dsc
for DEB in *.deb; do
cloudsmith push deb bley/bley/debian/sid "${DEB}"
done
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}