Skip to content

Commit f96f90c

Browse files
committed
feat(ci): add build and publish workflow
1 parent a0e35eb commit f96f90c

File tree

2 files changed

+53
-5
lines changed

2 files changed

+53
-5
lines changed

.github/workflows/publish-release.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Build 🏗️ and Publish 📦️
2+
3+
on:
4+
push:
5+
tags: ['*']
6+
7+
jobs:
8+
create-release:
9+
name: Create Release
10+
runs-on: ubuntu-22.04
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Create release ${{ github.ref }} as a draft
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
run: |
17+
gh release create "${{ github.ref }}" --draft --generate-notes
18+
19+
build-release:
20+
needs: [create-release]
21+
name: Build Release
22+
runs-on: ubuntu-22.04
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Build .deb
26+
run: |
27+
apt-get -y update
28+
apt-get -y install debhelper devscripts
29+
REL_VER=$(grep "^readonly VERSION" deb-get | cut -d'"' -f2)
30+
dch -v "${REL_VER}-1" --distribution=unstable "New upstream release."
31+
dpkg-buildpackage --build=binary --no-check-builddeps --compression=gzip
32+
- name: Upload .deb
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
run: |
36+
for artefact in "../"*_all.deb; do
37+
gh release upload "${{ github.ref }}" "${artefact}" --clobber
38+
done
39+
40+
publish-release:
41+
name: Publish Release
42+
needs: [build-release]
43+
runs-on: ubuntu-22.04
44+
steps:
45+
- uses: actions/checkout@v4
46+
- name: Publish release ${{ github.ref }}
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
run: |
50+
if [ "$(gh release view "${{ github.ref }}" --json assets --template '{{len .assets}}')" -lt 0 ]; then
51+
exit 1
52+
fi
53+
gh release edit "${{ github.ref }}" --draft=false

deb-build.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)