-
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (74 loc) · 2.66 KB
/
sbuild-deploy-pkg.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
name: sbuild deploy pkg
on:
workflow_call:
inputs:
pkg:
description: pkg name
required: true
type: string
version:
description: version for the pkg
required: true
type: string
jobs:
sbuild-deploy-pkg:
name: sbuild deploy pkg
runs-on: ubuntu-22.04
environment: PACKAGECLOUD
strategy:
fail-fast: false
matrix:
distro: [bullseye,bookworm]
arch: [arm64]
steps:
- name: Check if inputs all exist and are not empty
run: |
if [ -z "${{ inputs.pkg }}" ]; then
echo "Error: pkg string is empty"
exit 1
else:
echo "pkg is "${{ inputs.pkg }}"
fi
if [ -z "${{ inputs.version }}" ]; then
echo "Error: version string is empty"
exit 1
else:
echo "Version is "${{ inputs.version }}"
fi
- name: Get current date
id: date
run: echo "date=$(date -u +'%Y%m%dt%H%M%S')" >> $GITHUB_ENV
- name: Set package filename
run: |
echo "filename=${{ inputs.pkg }}_${{ inputs.version }}~gha${{ env.date }}+${{ matrix.arch }}_${{ matrix.distro }}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
- name: sbuild deb pkg for ${{ matrix.distro }}+${{ matrix.arch }}
uses: wlan-pi/sbuild-debian-package@main
id: build-debian-package
with:
distro: ${{ matrix.distro }}
arch: ${{ matrix.arch }}
- name: Archive artifacts and upload to GitHub
uses: actions/upload-artifact@v4
with:
name: ${{ env.filename }}
path: ${{ steps.build-debian-package.outputs.deb-package }}
- name: Upload armhf pkg to raspbian/${{ matrix.distro }}
if: ${{ matrix.arch == 'armhf' && (github.repository_owner == 'WLAN-Pi') }}
uses: danielmundi/upload-packagecloud@main
with:
package-name: ${{ steps.build-debian-package.outputs.deb-package }}
packagecloud-username: wlanpi
packagecloud-repo: dev
packagecloud-distrib: raspbian/${{ matrix.distro }}
packagecloud-token: ${{ secrets.PACKAGECLOUD_TOKEN }}
- name: Upload arm64 pkg to debian/${{ matrix.distro }}
if: ${{ matrix.arch == 'arm64' && (github.repository_owner == 'WLAN-Pi') }}
uses: danielmundi/upload-packagecloud@main
with:
package-name: ${{ steps.build-debian-package.outputs.deb-package }}
packagecloud-username: wlanpi
packagecloud-repo: dev
packagecloud-distrib: debian/${{ matrix.distro }}
packagecloud-token: ${{ secrets.PACKAGECLOUD_TOKEN }}