Skip to content

Commit

Permalink
feat: Package for linux arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
yanguoyu committed Oct 17, 2023
1 parent 0c48a06 commit 8a866f4
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 9 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,16 @@ jobs:
name: Neuron-Win
path: release/Neuron-*-setup.exe

- name: Upload Neuron Linux
- name: Upload Neuron Linux(x64)
if: matrix.os == 'ubuntu-20.04'
uses: actions/upload-artifact@v3
with:
name: Neuron-Linux
path: release/Neuron-*.AppImage
name: Neuron-Linux-x64
path: release/Neuron-*-x64.AppImage

- name: Upload Neuron Linux(arm64)
if: matrix.os == 'ubuntu-20.04'
uses: actions/upload-artifact@v3
with:
name: Neuron-Linux-arm64
path: release/Neuron-*-arm64.AppImage
11 changes: 9 additions & 2 deletions .github/workflows/package_for_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,19 @@ jobs:
name: Neuron-Win
path: release/Neuron-*-setup.exe

- name: Upload Neuron Linux
- name: Upload Neuron Linux(x64)
if: matrix.os == 'ubuntu-20.04'
uses: actions/upload-artifact@v3
with:
name: Neuron-Linux
path: release/Neuron-*.AppImage
path: release/Neuron-*-arm64.AppImage

- name: Upload Neuron Linux(x64)
if: matrix.os == 'ubuntu-20.04'
uses: actions/upload-artifact@v3
with:
name: Neuron-Linux
path: release/Neuron-*-arm64.AppImage

comment_when_package_success:
needs: [packaging]
Expand Down
5 changes: 4 additions & 1 deletion packages/neuron-wallet/electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,14 @@ linux:
category: Finance
icon: assets/icons/
extraFiles:
- from: "bin/linux/ckb"
- from: "bin/linux/ckb-${arch}"
to: "bin/ckb"
- from: "bin/linux/ckb-light-client"
to: "bin/ckb-light-client"
- from: "light/ckb_light.toml"
to: "light/ckb_light.toml"
target:
- AppImage
arch:
- arm64
- x64
19 changes: 18 additions & 1 deletion scripts/download-ckb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,30 @@ function download_macos_light() {
}

function download_linux() {
download_linux_x86_64
download_linux_aarch64
}

function download_linux_x86_64() {
# Linux
CKB_FILENAME="ckb_${CKB_VERSION}_x86_64-unknown-linux-gnu-portable"
cd $ROOT_DIR/packages/neuron-wallet/bin/linux

curl -O -L "${GITHUB_RELEASE_URL}/${CKB_VERSION}/${CKB_FILENAME}.tar.gz"
tar xvzf ${CKB_FILENAME}.tar.gz
cp ${CKB_FILENAME}/ckb ./
cp ${CKB_FILENAME}/ckb ./ckb-x64
rm -rf $CKB_FILENAME
rm ${CKB_FILENAME}.tar.gz
}

function download_linux_aarch64() {
# for linux arm64
CKB_FILENAME="ckb_${CKB_VERSION}_aarch64-unknown-linux-gnu"
cd $ROOT_DIR/packages/neuron-wallet/bin/linux

curl -O -L "${GITHUB_RELEASE_URL}/${CKB_VERSION}/${CKB_FILENAME}.tar.gz"
tar xvzf ${CKB_FILENAME}.tar.gz
cp ${CKB_FILENAME}/ckb ./ckb-arm64
rm -rf $CKB_FILENAME
rm ${CKB_FILENAME}.tar.gz
}
Expand Down
5 changes: 3 additions & 2 deletions scripts/release-checksums.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
macos_x64_dmg = "https://github.com/nervosnetwork/neuron/releases/download/#{tag}/Neuron-#{tag}-x64.dmg"
macos_arm64_dmg = "https://github.com/nervosnetwork/neuron/releases/download/#{tag}/Neuron-#{tag}-arm64.dmg"

linux_appimage = "https://github.com/nervosnetwork/neuron/releases/download/#{tag}/Neuron-#{tag}-x86_64.AppImage"
linux_x64_appimage = "https://github.com/nervosnetwork/neuron/releases/download/#{tag}/Neuron-#{tag}-x64.AppImage"
linux_arm64_appimage = "https://github.com/nervosnetwork/neuron/releases/download/#{tag}/Neuron-#{tag}-arm64.AppImage"

def get_sha256_checksum(url)
content = URI.open(url).read
Digest::SHA256.hexdigest(content)
end

windows_exe_sha256, macos_x64_zip_sha256, macos_arm64_zip_sha256, macos_x64_dmg_sha256, macos_arm64_dmg_sha256, linux_appimage_sha256 = [windows_exe, macos_x64_zip, macos_arm64_zip, macos_x64_dmg, macos_arm64_dmg, linux_appimage].map do |url|
windows_exe_sha256, macos_x64_zip_sha256, macos_arm64_zip_sha256, macos_x64_dmg_sha256, macos_arm64_dmg_sha256, linux_appimage_sha256 = [windows_exe, macos_x64_zip, macos_arm64_zip, macos_x64_dmg, macos_arm64_dmg, linux_x64_appimage, linux_arm64_appimage].map do |url|
Thread.new { get_sha256_checksum(url) }
end.map(&:value)

Expand Down

0 comments on commit 8a866f4

Please sign in to comment.