-
Notifications
You must be signed in to change notification settings - Fork 1
119 lines (103 loc) · 4.06 KB
/
misc-upstream-deb-mirror.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Building Upstream Debian Packages Directly
on:
workflow_dispatch:
push:
paths:
- ".github/workflows/misc-upstream-deb-mirror.yml"
env:
DEB_BUILD_DOCKER_IMAGE: "pitop/pi-top-os-deb-build"
DEB_BUILD_DOCKER_TAG: "bullseye-master"
PACKAGECLOUD_REPO: "experimental"
OS: "debian"
DISTRO: "bullseye"
jobs:
build-debian-package:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- repo: "AndrewFromMelbourne/raspi2png"
# get last commit
use_release_ref: "false"
patch: "sed -i 's/libpng12/libpng/g' debian/control"
- repo: "JoseExposito/touche"
use_release_ref: "true"
# sed -i 's/npm (>= 3)/npm/g' debian/control &&
patch: "sed -i 's/focal/bullseye/g' debian/changelog && echo -e '\n\n\noverride_dh_auto_build:\n npm ci\n dh_auto_build\n\noverride_dh_clean:\n rm -rf node_modules\n dh_clean' >> debian/rules"
- repo: "JoseExposito/touchegg"
use_release_ref: "true"
patch: "sed -i 's/focal/bullseye/g' debian/changelog"
steps:
- id: last_release
if: matrix.use_release_ref == 'true'
uses: thebritican/fetch-latest-release@v2.0.0
with:
repo_path: ${{ matrix.repo }}
- name: Checkout last release
if: matrix.use_release_ref == 'true'
uses: actions/checkout@v2.3.4
with:
repository: ${{ matrix.repo }}
ref: ${{ steps.last_release.outputs.tag_name }}
- name: Checkout last commit
if: matrix.use_release_ref != 'true'
uses: actions/checkout@v2.3.4
with:
repository: ${{ matrix.repo }}
- name: Fix source
if: matrix.patch != ''
run: ${{ matrix.patch }}
# We only want ARM builds. This step is here to provide the option of
# using a strategy matrix if additional builds (e.g. `arm64`) are desired
- name: Determine architecture to use from package info
# If architecture is 'all', then it can be compiled on host architecture
# All other pi-topOS cases require 'armhf'
run: |
target_architecture=amd64
if grep '^Architecture:' debian/control | grep -q -v 'all'; then
target_architecture=armhf
fi
echo "TARGET_ARCHITECTURE=${target_architecture}" >> $GITHUB_ENV
- name: Build Debian package
uses: pi-top/debian-package-build-action@master
with:
target_architecture: ${{ env.TARGET_ARCHITECTURE }}
docker_image: ${{ env.DEB_BUILD_DOCKER_IMAGE }}:${{ env.DEB_BUILD_DOCKER_TAG }}
signing_key: ${{ secrets.DEB_SIGNING_GPG_KEY }}
signing_passphrase: ${{ secrets.DEB_SIGNING_GPG_PASSPHRASE }}
build_directory: ./artifacts
# Optional, repo-specific build environment variables
additional_env: |
DATA="${{ secrets.DATA }}"
TLS_KEY="${{ secrets.TLS_KEY }}"
LINTIAN_NO_FAIL: "1"
- name: Generate artifact name
run: |
echo "ARTIFACT_PREFIX=$(basename -s .dsc "$(find . -name "*.dsc")")" >> $GITHUB_ENV
- name: Upload binary package artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ env.ARTIFACT_PREFIX }}.deb
path: ./artifacts/*.deb
- name: Upload source package artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ env.ARTIFACT_PREFIX }}.deb-src
path: ./artifacts/*.tar.xz
- name: Upload package build metadata artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ env.ARTIFACT_PREFIX }}.metadata
path: |
./artifacts/**
!./artifacts/*.deb
!./artifacts/*.tar.xz
- uses: pi-top/ghaction-packagecloud@main
with:
repository: ${{ env.PACKAGECLOUD_REPO }}/${{ env.OS }}/${{ env.DISTRO }}
files: |
./artifacts/*.dsc
./artifacts/*.deb
env:
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}