forked from flameshot-org/flameshot
-
Notifications
You must be signed in to change notification settings - Fork 0
153 lines (138 loc) · 5.01 KB
/
Linux-arm-pack.yml
File metadata and controls
153 lines (138 loc) · 5.01 KB
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: Packaging(Linux - ARM)
on:
#push:
# branches:
# - master
# - fix*
# - move-arm-ci-to-new-ci
# paths-ignore:
# - 'README.md'
# - 'LICENSE'
# - 'docs/**'
workflow_dispatch:
env:
PRODUCT: flameshot
RELEASE: 1
# dockerfiles, see https://github.com/flameshot-org/flameshot-dockerfiles
# docker images, see https://quay.io/repository/flameshot-org/ci-building
DOCKER_REPO: quay.io/flameshot-org/ci-building
# building tool: https://github.com/flameshot-org/packpack
PACKPACK_REPO: flameshot-org/packpack
jobs:
deb-pack:
name: Build deb on ${{ matrix.dist.name }} ${{ matrix.dist.arch }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dist:
# - {
# name: debian-11,
# os: debian,
# symbol: bullseye,
# arch: armhf
# }
- {
name: debian-12,
os: debian,
symbol: bookworm,
arch: arm64
}
- {
name: debian-12,
os: debian,
symbol: bookworm,
arch: armhf
}
- {
name: ubuntu-22.04,
os: ubuntu,
symbol: jammy,
arch: arm64
}
- {
name: ubuntu-24.04,
os: ubuntu,
symbol: noble,
arch: arm64
}
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Checkout Source code
if: github.event_name == 'push'
uses: actions/checkout@v6
with:
fetch-depth: 0
# ref: master
- name: Checkout Source code
if: github.event_name == 'pull_request'
uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Checkout Source code
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v6
with:
ref: ${{ github.sha }}
- name: Set env & Print flameshot version
shell: bash
run: |
last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
git_hash=$(git rev-parse --short HEAD)
ver_info=${last_committed_tag}+git${git_revno}.${git_hash}
echo "=======FLAMESHOT VERSION========"
echo ${last_committed_tag:1}
echo "Details: ${ver_info}"
echo "================================"
# This will allow to build pre-preleases without git tag
# echo "VERSION=${last_committed_tag:1}" >> $GITHUB_ENV
echo "VERSION=$(cat CMakeLists.txt |grep 'set.*(.*FLAMESHOT_VERSION' | sed 's/[^0-9.]*//' |sed 's/)//g')" >> $GITHUB_ENV
echo "VER_INFO=${ver_info}" >> $GITHUB_ENV
echo "GIT_HASH=${git_hash}" >> $GITHUB_ENV
- name: Get packpack tool
uses: actions/checkout@v6
with:
repository: ${{ env.PACKPACK_REPO }}
path: tools
ref: multiarch
set-safe-directory: $GITHUB_WORKSPACE/tools
- name: Packaging on ${{ matrix.dist.name }} ${{ matrix.dist.arch }}
env:
OS: ${{ matrix.dist.os }}
DIST: ${{ matrix.dist.symbol }}
DOCKER_ARCH: ${{ matrix.dist.arch }}
run: |
case ${DOCKER_ARCH} in
arm32v7)
export ARCH=arm/v7
;;
armhf)
export ARCH=arm/v7
;;
arm64*)
export ARCH=arm64
;;
*)
export ARCH=${DOCKER_ARCH}
;;
esac
cp -r $GITHUB_WORKSPACE/packaging/debian $GITHUB_WORKSPACE
bash $GITHUB_WORKSPACE/tools/packpack
mv $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}_${{ matrix.dist.arch }}.deb $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist.name }}.${{ matrix.dist.arch }}.deb
- name: SHA256Sum of ${{ matrix.dist.name }} ${{ matrix.dist.arch }} package
run: |
cd "$GITHUB_WORKSPACE/build/" || { >&2 echo "Cannot cd to '$GITHUB_WORKSPACE/build/'!"; exit 11 ; }
sha256sum ${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist.name }}.${{ matrix.dist.arch }}.deb | tee ${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist.name }}.${{ matrix.dist.arch }}.deb.sha256sum
- name: Artifact Upload
uses: actions/upload-artifact@v7
with:
name: ${{ env.PRODUCT }}-${{ env.VER_INFO }}-artifact-${{ matrix.dist.name }}-${{ matrix.dist.arch }}
path: |
${{ github.workspace }}/build/${{ env.PRODUCT }}-*-${{ env.RELEASE }}.${{ matrix.dist.name }}.${{ matrix.dist.arch }}.deb
${{ github.workspace }}/build/${{ env.PRODUCT }}-*-${{ env.RELEASE }}.${{ matrix.dist.name }}.${{ matrix.dist.arch }}.deb.sha256sum
overwrite: true