|
1 | | -# name: 'publish' |
| 1 | +# name: 'Publish Linux Arm' |
2 | 2 |
|
3 | 3 | # on: |
| 4 | +# workflow_dispatch: |
4 | 5 | # push: |
5 | 6 | # branches: |
6 | 7 | # - webdev |
7 | 8 |
|
| 9 | +# # linux arm 需要配置tauri.conf.json target 只要 linux |
| 10 | +# # The bundle targets, currently supports [“deb”, “rpm”] or "all" |
8 | 11 | # jobs: |
9 | | -# alpha-for-linux-arm: # 针对 Linux ARM 架构的构建任务 |
| 12 | +# build: |
| 13 | +# runs-on: ubuntu-22.04 |
| 14 | + |
10 | 15 | # strategy: |
11 | | -# fail-fast: false |
12 | 16 | # matrix: |
| 17 | +# arch: [aarch64, armv7l] |
13 | 18 | # include: |
14 | | -# - os: ubuntu-22.04 |
15 | | -# target: aarch64-unknown-linux-gnu # 目标架构:aarch64 |
16 | | -# arch: arm64 |
17 | | -# - os: ubuntu-22.04 |
18 | | -# target: armv7-unknown-linux-gnueabihf # 目标架构:armv7 |
19 | | -# arch: armhf |
20 | | -# runs-on: ${{ matrix.os }} |
21 | | -# steps: |
22 | | -# - name: Checkout Repository # 检出代码库 |
23 | | -# uses: actions/checkout@v4 |
| 19 | +# - arch: aarch64 |
| 20 | +# cpu: cortex-a72 |
| 21 | +# base_image: https://dietpi.com/downloads/images/DietPi_RPi-ARMv8-Bookworm.img.xz |
| 22 | +# deb: arm64 |
| 23 | +# rpm: aarch64 |
| 24 | +# appimage: aarch64 |
| 25 | +# - arch: armv7l |
| 26 | +# cpu: cortex-a53 |
| 27 | +# deb: armhfp |
| 28 | +# rpm: arm |
| 29 | +# appimage: armhf |
| 30 | +# base_image: https://dietpi.com/downloads/images/DietPi_RPi-ARMv7-Bookworm.img.xz |
24 | 31 |
|
25 | | -# - name: Install Rust Stable # 安装稳定版的 Rust |
26 | | -# uses: dtolnay/rust-toolchain@stable |
27 | | - |
28 | | -# - name: Add Rust Target # 添加 Rust 目标架构 |
29 | | -# run: rustup target add ${{ matrix.target }} |
| 32 | +# steps: |
| 33 | +# - uses: actions/checkout@v4 |
30 | 34 |
|
31 | | -# - name: Rust Cache # 设置 Rust 缓存 |
| 35 | +# - name: Cache rust build artifacts |
32 | 36 | # uses: Swatinem/rust-cache@v2 |
33 | 37 | # with: |
34 | 38 | # workspaces: src-tauri |
35 | | -# cache-all-crates: true |
| 39 | +# cache-on-failure: true |
36 | 40 |
|
37 | | -# - uses: pnpm/action-setup@v3 |
| 41 | +# - name: Build app |
| 42 | +# uses: pguyot/arm-runner-action@v2.6.5 |
38 | 43 | # with: |
39 | | -# version: latest |
40 | | - |
41 | | -# - name: Sync node version and setup cache |
42 | | -# uses: actions/setup-node@v4 |
| 44 | +# base_image: ${{ matrix.base_image }} |
| 45 | +# cpu: ${{ matrix.cpu }} |
| 46 | +# bind_mount_repository: true |
| 47 | +# image_additional_mb: 10240 |
| 48 | +# optimize_image: no |
| 49 | +# #exit_on_fail: no |
| 50 | +# commands: | |
| 51 | +# # Prevent Rust from complaining about $HOME not matching eid home |
| 52 | +# export HOME=/root |
| 53 | +# # Workaround to CI worker being stuck on Updating crates.io index |
| 54 | +# export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse |
| 55 | +# # Install setup prerequisites |
| 56 | +# apt-get update -y --allow-releaseinfo-change |
| 57 | +# apt-get autoremove -y |
| 58 | +# apt-get install -y --no-install-recommends --no-install-suggests curl libwebkit2gtk-4.1-dev build-essential libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev patchelf libfuse2 file |
| 59 | +# curl https://sh.rustup.rs -sSf | sh -s -- -y |
| 60 | +# . "$HOME/.cargo/env" |
| 61 | +# curl -fsSL https://deb.nodesource.com/setup_lts.x | bash |
| 62 | +# apt-get install -y nodejs |
| 63 | +# # Install frontend dependencies |
| 64 | +# npm install -g pnpm |
| 65 | +# pnpm install |
| 66 | +# # Build the application |
| 67 | +# pnpm tauri build -- --verbose |
| 68 | +# - name: Get app version |
| 69 | +# run: echo "APP_VERSION=$(jq -r .version src-tauri/tauri.conf.json)" >> $GITHUB_ENV |
| 70 | + |
| 71 | +# # TODO: Combine this with the basic workflow and upload the files to the Release. |
| 72 | +# - name: Upload deb bundle |
| 73 | +# uses: actions/upload-artifact@v4 |
43 | 74 | # with: |
44 | | -# node-version: 20 |
45 | | -# cache: pnpm |
46 | | - |
47 | | -# - name: Install frontend dependencies |
48 | | -# run: pnpm install |
49 | | - |
50 | | -# - name: 'Setup for linux' # 设置 Linux 环境 |
51 | | -# run: |- |
52 | | -# sudo ls -lR /etc/apt/ |
53 | | - |
54 | | -# cat > /tmp/sources.list << EOF |
55 | | -# deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu jammy main multiverse universe restricted |
56 | | -# deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu jammy-security main multiverse universe restricted |
57 | | -# deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu jammy-updates main multiverse universe restricted |
58 | | -# deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu jammy-backports main multiverse universe restricted |
| 75 | +# name: Debian Bundle |
| 76 | +# path: ${{ github.workspace }}/src-tauri/target/release/bundle/deb/Baidu_${{ env.APP_VERSION }}_${{ matrix.deb }}.deb |
59 | 77 |
|
60 | | -# deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy main multiverse universe restricted |
61 | | -# deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-security main multiverse universe restricted |
62 | | -# deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-updates main multiverse universe restricted |
63 | | -# deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-backports main multiverse universe restricted |
64 | | -# EOF |
65 | | - |
66 | | -# sudo mv /etc/apt/sources.list /etc/apt/sources.list.default |
67 | | -# sudo mv /tmp/sources.list /etc/apt/sources.list |
68 | | - |
69 | | -# sudo dpkg --add-architecture ${{ matrix.arch }} |
70 | | -# sudo apt update |
71 | | - |
72 | | -# sudo apt install -y \ |
73 | | -# libwebkit2gtk-4.1-dev:${{ matrix.arch }} \ |
74 | | -# libayatana-appindicator3-dev:${{ matrix.arch }} \ |
75 | | -# libssl-dev:${{ matrix.arch }} \ |
76 | | -# patchelf:${{ matrix.arch }} \ |
77 | | -# librsvg2-dev:${{ matrix.arch }} |
78 | | - |
79 | | -# - name: 'Install aarch64 tools' # 安装 aarch64 工具链 |
80 | | -# if: matrix.target == 'aarch64-unknown-linux-gnu' |
81 | | -# run: | |
82 | | -# sudo apt install -y \ |
83 | | -# gcc-aarch64-linux-gnu \ |
84 | | -# g++-aarch64-linux-gnu |
85 | | - |
86 | | -# - name: 'Install armv7 tools' # 安装 armv7 工具链 |
87 | | -# if: matrix.target == 'armv7-unknown-linux-gnueabihf' |
88 | | -# run: | |
89 | | -# sudo apt install -y \ |
90 | | -# gcc-arm-linux-gnueabihf \ |
91 | | -# g++-arm-linux-gnueabihf |
92 | | - |
93 | | -# - name: Build for Linux # 构建 Linux 应用程序 |
94 | | -# run: | |
95 | | -# export PKG_CONFIG_ALLOW_CROSS=1 |
96 | | -# if [ "${{ matrix.target }}" == "aarch64-unknown-linux-gnu" ]; then |
97 | | -# export PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig/:$PKG_CONFIG_PATH |
98 | | -# export PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu/ |
99 | | -# elif [ "${{ matrix.target }}" == "armv7-unknown-linux-gnueabihf" ]; then |
100 | | -# export PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig/:$PKG_CONFIG_PATH |
101 | | -# export PKG_CONFIG_SYSROOT_DIR=/usr/arm-linux-gnueabihf/ |
102 | | -# fi |
103 | | -# pnpm tauri build --target ${{ matrix.target }} |
104 | | -# env: |
105 | | -# NODE_OPTIONS: '--max_old_space_size=4096' |
106 | | - |
107 | | -# - name: Get Version # 获取版本号 |
108 | | -# run: | |
109 | | -# sudo apt-get update |
110 | | -# sudo apt-get install jq |
111 | | -# echo "VERSION=$(cat package.json | jq '.version' | tr -d '"')" >> $GITHUB_ENV |
112 | | -# echo "BUILDTIME=$(TZ=Asia/Shanghai date)" >> $GITHUB_ENV |
| 78 | +# - name: Upload rpm bundle |
| 79 | +# uses: actions/upload-artifact@v4 |
| 80 | +# with: |
| 81 | +# name: RPM Bundle |
| 82 | +# path: ${{ github.workspace }}/src-tauri/target/release/bundle/rpm/Baidu_${{ env.APP_VERSION }}-1.${{ matrix.rpm }}.rpm |
113 | 83 |
|
114 | | -# - name: Upload Release # 上传发布文件 |
115 | | -# uses: softprops/action-gh-release@v2 |
| 84 | +# - name: Upload appimage bundle |
| 85 | +# uses: actions/upload-artifact@v4 |
116 | 86 | # with: |
117 | | -# tag_name: alpha |
118 | | -# name: 'Clash Verge Rev Alpha' |
119 | | -# body: 'More new features are now supported.' |
120 | | -# prerelease: true |
121 | | -# token: ${{ secrets.GITHUB_TOKEN }} |
122 | | -# files: | |
123 | | -# src-tauri/target/${{ matrix.target }}/release/bundle/deb/*.deb |
124 | | -# src-tauri/target/${{ matrix.target }}/release/bundle/rpm/*.rpm |
| 87 | +# name: AppImage Bundle |
| 88 | +# path: ${{ github.workspace }}/src-tauri/target/release/bundle/appimage/Baidu_${{ env.APP_VERSION }}_${{ matrix.appimage }}.AppImage |
0 commit comments