Skip to content

Commit 7ac6161

Browse files
committed
feat(ci): automate debian package build and upload
1 parent 755cb6d commit 7ac6161

File tree

1 file changed

+36
-3
lines changed

1 file changed

+36
-3
lines changed

.github/workflows/publish-docker.yml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: Publish Docker Image
1+
name: Publish Docker Image and Debian Package
22

33
on:
44
release:
55
types: [published]
66

77
jobs:
8-
build-and-publish:
8+
build-and-publish-docker:
99
runs-on: ubuntu-latest
1010
permissions:
1111
contents: read
@@ -34,4 +34,37 @@ jobs:
3434
context: .
3535
push: true
3636
tags: ${{ steps.meta.outputs.tags }}
37-
labels: ${{ steps.meta.outputs.labels }}
37+
labels: ${{ steps.meta.outputs.labels }}
38+
39+
build-and-upload-deb:
40+
runs-on: ubuntu-latest
41+
permissions:
42+
contents: write # Needed to upload release assets
43+
44+
steps:
45+
- name: Checkout repository
46+
uses: actions/checkout@v4
47+
48+
- name: Install Go
49+
uses: actions/setup-go@v5
50+
with:
51+
go-version: '1.22'
52+
53+
- name: Set release version in build script
54+
run: |
55+
# The tag is like 'v0.2.2', we just want '0.2.2'
56+
RELEASE_VERSION=${{ github.ref_name }}
57+
VERSION_NUMBER=${RELEASE_VERSION#v}
58+
sed -i "s/^VERSION=.*/VERSION=\"${VERSION_NUMBER}\"/" build_packages.sh
59+
60+
- name: Build the Debian package
61+
run: bash build_packages.sh
62+
63+
- name: Upload Debian package to release
64+
uses: svenstaro/upload-release-action@v2
65+
with:
66+
repo_token: ${{ secrets.GITHUB_TOKEN }}
67+
file: docker-ai_*.deb
68+
asset_name: docker-ai_${{ github.ref_name }}_amd64.deb
69+
tag: ${{ github.ref_name }}
70+
overwrite: true

0 commit comments

Comments
 (0)