-
-
Notifications
You must be signed in to change notification settings - Fork 6
executable file
·75 lines (67 loc) · 2.12 KB
/
release.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
name: CI for release tags
on:
push:
tags:
- "v*" # matches v1.0.1, v1.2, v2, etc
jobs:
once:
name: Create single release for all builds
runs-on: ubuntu-22.04
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create a release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: true
build:
name: Build release for ${{ matrix.target }}
needs: once
runs-on: ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
target:
- ubuntu-20.04
- ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: upgrade
run: sudo apt update && sudo apt -y full-upgrade
- name: install packages required for the build
run: |
sudo DEBIAN_FRONTEND=noninteractive apt -qq -y install -qq devscripts equivs lintian
mk-build-deps -i -s sudo -t "apt --yes --no-install-recommends"
- name: build source package
env:
DEBFULLNAME: "Github Actions"
DEBEMAIL: "[email protected]"
run: |
export TARGET=$(. /etc/lsb-release && echo $DISTRIB_CODENAME)
git fetch --unshallow
git fetch --tags
VERSION="$(git describe --tags | sed -e "s/^v//" -e "s/-/+git/")"
dch --create \
--distribution ${TARGET} \
--package bpp \
--newversion ${VERSION}~${TARGET}1 \
"Automatic build from Github"
debuild -S -sa -us -uc -d
- name: build binary package
run: dpkg-buildpackage -b -rfakeroot -us -uc
- name: Upload build artefacts to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ../*.deb
tag: ${{ github.ref }}
overwrite: true
file_glob: true