Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
5f2848f3
Unverified
Commit
5f2848f3
authored
3 years ago
by
Richard van der Hoff
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
build debs in GHA (#10247)
GHA workflow to build the debs
parent
b5d42377
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.github/workflows/debs.yml
+44
-0
44 additions, 0 deletions
.github/workflows/debs.yml
changelog.d/10247.misc
+1
-0
1 addition, 0 deletions
changelog.d/10247.misc
scripts-dev/build_debian_packages
+13
-4
13 additions, 4 deletions
scripts-dev/build_debian_packages
with
58 additions
and
4 deletions
.github/workflows/debs.yml
0 → 100644
+
44
−
0
View file @
5f2848f3
# GitHub actions workflow which builds the debian packages.
name
:
Debs
on
:
push
:
branches
:
[
"
develop"
,
"
release-*"
]
permissions
:
contents
:
read
jobs
:
# first get the list of distros to build for.
get-distros
:
runs-on
:
ubuntu-latest
steps
:
-
uses
:
actions/checkout@v2
-
uses
:
actions/setup-python@v2
-
id
:
set-distros
run
:
|
echo "::set-output name=distros::$(scripts-dev/build_debian_packages --show-dists-json)"
# map the step outputs to job outputs
outputs
:
distros
:
${{ steps.set-distros.outputs.distros }}
# now build the packages with a matrix build.
build-debs
:
needs
:
get-distros
name
:
"
Build
.deb
packages"
runs-on
:
ubuntu-latest
strategy
:
matrix
:
distro
:
${{ fromJson(needs.get-distros.outputs.distros) }}
steps
:
-
uses
:
actions/checkout@v2
with
:
path
:
src
-
uses
:
actions/setup-python@v2
-
run
:
./src/scripts-dev/build_debian_packages "${{ matrix.distro }}"
-
uses
:
actions/upload-artifact@v2
with
:
name
:
packages
path
:
debs/*
This diff is collapsed.
Click to expand it.
changelog.d/10247.misc
0 → 100644
+
1
−
0
View file @
5f2848f3
Build the Debian packages in CI.
This diff is collapsed.
Click to expand it.
scripts-dev/build_debian_packages
+
13
−
4
View file @
5f2848f3
...
...
@@ -10,6 +10,7 @@
# can be passed on the commandline for debugging.
import
argparse
import
json
import
os
import
signal
import
subprocess
...
...
@@ -34,6 +35,8 @@ By default, builds for all known distributions, but a list of distributions
can be passed on the commandline for debugging.
"""
projdir
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)))
class
Builder
(
object
):
def
__init__
(
self
,
redirect_stdout
=
False
):
...
...
@@ -57,9 +60,6 @@ class Builder(object):
raise
def
_inner_build
(
self
,
dist
,
skip_tests
=
False
):
projdir
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)))
os
.
chdir
(
projdir
)
tag
=
dist
.
split
(
"
:
"
,
1
)[
1
]
# Make the dir where the debs will live.
...
...
@@ -93,6 +93,7 @@ class Builder(object):
],
stdout
=
stdout
,
stderr
=
subprocess
.
STDOUT
,
cwd
=
projdir
,
)
container_name
=
"
synapse_build_
"
+
tag
...
...
@@ -179,6 +180,11 @@ if __name__ == "__main__":
action
=
"
store_true
"
,
help
=
"
skip running tests after building
"
,
)
parser
.
add_argument
(
"
--show-dists-json
"
,
action
=
"
store_true
"
,
help
=
"
instead of building the packages, just list the dists to build for, as a json array
"
,
)
parser
.
add_argument
(
"
dist
"
,
nargs
=
"
*
"
,
...
...
@@ -186,4 +192,7 @@ if __name__ == "__main__":
help
=
"
a list of distributions to build for. Default: %(default)s
"
,
)
args
=
parser
.
parse_args
()
run_builds
(
dists
=
args
.
dist
,
jobs
=
args
.
jobs
,
skip_tests
=
args
.
no_check
)
if
args
.
show_dists_json
:
print
(
json
.
dumps
(
DISTS
))
else
:
run_builds
(
dists
=
args
.
dist
,
jobs
=
args
.
jobs
,
skip_tests
=
args
.
no_check
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment