Skip to content

Commit f28f14b

Browse files
committed
Setup publish to work with both arm64 and amd64
1 parent fbe2c7b commit f28f14b

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

.github/workflows/publish.yml

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ jobs:
6767

6868
debian-publish:
6969
needs: debian-build
70+
strategy:
71+
matrix:
72+
architecture: [arm64, amd64]
7073
runs-on: ubuntu-latest
7174

7275
steps:
@@ -76,8 +79,11 @@ jobs:
7679
path: "app"
7780

7881
- name: Extract variables
82+
env:
83+
ARCHITECTURE: ${{ matrix.architecture }}
7984
run: |
8085
echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
86+
echo "ARCHITECTURE=${ARCHITECTURE}" >> $GITHUB_ENV
8187
8288
# Get the tag's commit message
8389
cd app/
@@ -91,22 +97,22 @@ jobs:
9197
9298
- name: Create folder structure for amd64 distribution
9399
run: |
94-
mkdir gitmastery-${VERSION}-amd64
100+
mkdir gitmastery-${VERSION}-${ARCHITECTURE}
95101
96-
- name: Download amd64 binaries from artifacts
102+
- name: Download ${{ matrix.architecture }} binaries from artifacts
97103
uses: actions/download-artifact@v4
98104
with:
99-
name: gitmastery-${{ env.VERSION }}-linux-amd64
100-
path: gitmastery-${{ env.VERSION }}-amd64/
105+
name: gitmastery-${{ env.VERSION }}-linux-${ARCHITECTURE}
106+
path: gitmastery-${{ env.VERSION }}-${ARCHITECTURE}/
101107

102108
- name: Create upstream tarball .orig.tar.gz
103109
run: |
104110
# Create .orig.tar.gz file
105-
tar -czf gitmastery_${VERSION}.orig.tar.gz gitmastery-${VERSION}-amd64/gitmastery-${VERSION}-linux-amd64
111+
tar -czf gitmastery_${VERSION}.orig.tar.gz gitmastery-${VERSION}-${ARCHITECTURE}/gitmastery-${VERSION}-linux-${ARCHITECTURE}
106112
tree
107113
108114
- name: Generate Debian packaging files
109-
working-directory: gitmastery-${{ env.VERSION }}-amd64
115+
working-directory: gitmastery-${{ env.VERSION }}-${{ matrix.architecture }}
110116
# TODO: Update to something agnostic
111117
env:
112118
EMAIL: woojiahao1234@gmail.com
@@ -129,7 +135,7 @@ jobs:
129135
Build-Depends: debhelper-compat (= 13)
130136
131137
Package: gitmastery
132-
Architecture: amd64
138+
Architecture: ${ARCHITECTURE}
133139
Depends: ${shlibs:Depends}, ${misc:Depends}
134140
Description: execute Git-Mastery
135141
gitmastery is a Git learning tool built by the National University of Singapore School of Computing
@@ -150,7 +156,7 @@ jobs:
150156
\tdh \$@
151157
\n
152158
override_dh_auto_install:
153-
\tinstall -D -m 0755 gitmastery-${VERSION}-linux-amd64 build/usr/bin/gitmastery
159+
\tinstall -D -m 0755 gitmastery-${VERSION}-linux-${ARCHITECTURE} build/usr/bin/gitmastery
154160
""" > debian/rules
155161
156162
echo """usr/bin
@@ -164,17 +170,6 @@ jobs:
164170
- name: Logging
165171
run: |
166172
tree
167-
cat gitmastery-${VERSION}/debian/changelog
168-
cat gitmastery-${VERSION}/debian/control
169-
cat gitmastery-${VERSION}/debian/copyright
170-
cat gitmastery-${VERSION}/debian/source/format
171-
cat gitmastery-${VERSION}/debian/rules
172-
173-
# - name: Download arm64 binaries from artifacts
174-
# uses: actions/download-artifact@v4
175-
# with:
176-
# name: gitmastery-${{ env.VERSION }}-linux-arm64
177-
# path: gitmastery-${{ env.VERSION }}/gitmastery-${{ env.VERSION }}-linux-arm64
178173
179174
windows:
180175
runs-on: windows-latest

0 commit comments

Comments
 (0)