Skip to content

Commit 91f5d0d

Browse files
committed
Add support for arm64 build
1 parent 35b5f18 commit 91f5d0d

File tree

3 files changed

+58
-21
lines changed

3 files changed

+58
-21
lines changed

.github/workflows/build_package.yml

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,44 +8,67 @@ jobs:
88
runs-on: ubuntu-latest
99
permissions:
1010
contents: write
11-
11+
strategy:
12+
matrix:
13+
arch: [x86_64, aarch64]
1214
steps:
1315
- name: Checkout
1416
uses: actions/checkout@v4
17+
- name: Set up QEMU
18+
if: ${{ matrix.arch != 'x86_64' }}
19+
uses: docker/setup-qemu-action@v3
20+
with:
21+
platforms: ${{ matrix.arch }}
1522
- name: Install Flatpak
1623
run:
1724
|
18-
sudo apt update
19-
sudo apt upgrade -y
20-
sudo apt install -y flatpak flatpak-builder
25+
sudo apt -qq update
26+
sudo apt -qq install -y flatpak flatpak-builder
2127
sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
22-
sudo flatpak install -y org.freedesktop.Platform//23.08
23-
sudo flatpak install -y org.freedesktop.Sdk//23.08
28+
sudo flatpak install --noninteractive --arch=${{ matrix.arch }} org.freedesktop.Platform//23.08 org.freedesktop.Sdk//23.08
2429
git config --global protocol.file.allow always # https://github.com/flatpak/flatpak-builder/issues/495
2530
- name: Build
2631
run:
2732
|
28-
flatpak-builder build com.tencent.WeChat.yaml --delete-build-dirs --force-clean
29-
flatpak-builder --repo=repo build com.tencent.WeChat.yaml --force-clean
30-
flatpak build-bundle ./repo com.tencent.WeChat.flatpak com.tencent.WeChat
31-
- name: Get current date
32-
id: date
33-
run: echo "CURRENT_DATE=$(date -u '+%y%m%d%H%M')" >> $GITHUB_OUTPUT
33+
flatpak-builder --arch=${{ matrix.arch }} --repo=repo build com.tencent.WeChat.yaml --delete-build-dirs --force-clean
34+
flatpak build-bundle --arch=${{ matrix.arch }} ./repo com.tencent.WeChat.flatpak com.tencent.WeChat
35+
mv com.tencent.WeChat.flatpak com.tencent.WeChat-${{ matrix.arch }}.flatpak
3436
- name: Upload to Artifact
3537
uses: actions/upload-artifact@v4
3638
with:
37-
name: flatpak-bundle
38-
path: com.tencent.WeChat.flatpak
39+
name: flatpak-bundle-${{ matrix.arch }}
40+
path: com.tencent.WeChat-${{ matrix.arch }}.flatpak
41+
42+
upload-release:
43+
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'
44+
runs-on: ubuntu-latest
45+
needs: build-bundle
46+
permissions:
47+
contents: write
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@v4
51+
- name: Install xmlstarlet
52+
run: sudo apt -qq update && sudo apt -qq install -y xmlstarlet
53+
- name: Download artifacts
54+
uses: actions/download-artifact@v4
55+
with:
56+
merge-multiple: true
57+
- name: Get current date & version
58+
id: env
59+
run:
60+
|
61+
echo "CURRENT_DATE=$(date -u '+%y%m%d%H%M')" >> $GITHUB_OUTPUT
62+
echo "VERSION=$(xmlstarlet sel -t -v //component/releases/release[1]/@version com.tencent.WeChat.metainfo.xml)" >> $GITHUB_OUTPUT
3963
- name: Upload to Release
40-
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'
4164
uses: softprops/action-gh-release@v2
4265
with:
43-
name: ${{ steps.date.outputs.CURRENT_DATE }}
44-
tag_name: ${{ steps.date.outputs.CURRENT_DATE }}
45-
files: com.tencent.WeChat.flatpak
66+
name: ${{ steps.env.outputs.VERSION }}
67+
tag_name: ${{ steps.env.outputs.VERSION }}-${{ steps.env.outputs.CURRENT_DATE }}
68+
files: com.tencent.WeChat-*.flatpak
4669
body:
4770
|
4871
install via:
4972
```
50-
flatpak install com.tencent.WeChat.flatpak
73+
flatpak install com.tencent.WeChat-<arch>.flatpak
5174
```

com.tencent.WeChat.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,19 @@ modules:
118118
url: https://archive2.kylinos.cn/deb/kylin/production/PART-V10-SP1/custom/partner/V10-SP1/pool/all/wechat-beta_1.0.0.241_amd64.deb
119119
sha256: 4ffe0cda779b46ad5d76b85bdc65136c9c89add4d0bc1175a34d8b94f516c4fb
120120
dest-filename: wechat.deb
121+
only-arches: [x86_64]
122+
x-checker-data:
123+
type: debian-repo
124+
package-name: wechat-beta
125+
root: https://archive2.kylinos.cn/deb/kylin/production/PART-V10-SP1/custom/partner/V10-SP1
126+
dist: default
127+
component: all
128+
is-main-source: true
129+
- type: file
130+
url: https://archive2.kylinos.cn/deb/kylin/production/PART-V10-SP1/custom/partner/V10-SP1/pool/all/wechat-beta_1.0.0.241_arm64.deb
131+
sha256: 344365a011e746fc682d7112d435a70484044e395c04a57b74aa27676af7026f
132+
dest-filename: wechat.deb
133+
only-arches: [aarch64]
121134
x-checker-data:
122135
type: debian-repo
123136
package-name: wechat-beta

flathub.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"only-arches": [
3-
"x86_64"
3+
"x86_64",
4+
"aarch64"
45
]
5-
}
6+
}

0 commit comments

Comments
 (0)