Skip to content

Commit

Permalink
pref: offline tar support arm64. (#4306)
Browse files Browse the repository at this point in the history
* pref: offline tar support arm64.

Signed-off-by: yy <lingdie.yy@outlook.com>

* Revert "pref: offline tar support arm64."

This reverts commit b6c93c2.

* pref: offline tar support arm64.

Signed-off-by: yy <lingdie.yy@outlook.com>

---------

Signed-off-by: yy <lingdie.yy@outlook.com>
  • Loading branch information
lingdie authored Nov 16, 2023
1 parent 87a14ea commit b6643a4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 7 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/cloud-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ jobs:
build_from: ${{ github.event.release.tag_name }}
secrets: inherit

release-offline-tar:
release-amd-offline-tar:
needs:
- release-cloud
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
run: export CLOUD_VERSION=${{ github.event.release.tag_name }} && bash ./scripts/cloud/build-offline-tar.sh
run: export CLOUD_VERSION=${{ github.event.release.tag_name }} && export ARCH=amd64 && bash ./scripts/cloud/build-offline-tar.sh
- name: Setup ossutil
uses: manyuanrong/setup-ossutil@v2.0
with:
Expand All @@ -68,5 +68,27 @@ jobs:
run: cat ./sealos-cloud.tar.gz.md5
- name: Upload
run: |
ossutil cp ./sealos-cloud.tar.gz oss://${{ secrets.OSS_BUCKET }}/cloud/sealos-cloud-${{ github.event.release.tag_name }}.tar.gz
ossutil cp ./sealos-cloud.tar.gz.md5 oss://${{ secrets.OSS_BUCKET }}/cloud/sealos-cloud-${{ github.event.release.tag_name }}.tar.gz.md5
ossutil cp ./sealos-cloud.tar.gz oss://${{ secrets.OSS_BUCKET }}/cloud/sealos-cloud-${{ github.event.release.tag_name }}-amd64.tar.gz
ossutil cp ./sealos-cloud.tar.gz.md5 oss://${{ secrets.OSS_BUCKET }}/cloud/sealos-cloud-${{ github.event.release.tag_name }}-amd64.tar.gz.md5
release-arm-offline-tar:
needs:
- release-cloud
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
run: export CLOUD_VERSION=${{ github.event.release.tag_name }} && export ARCH=arm64 && bash ./scripts/cloud/build-offline-tar.sh
- name: Setup ossutil
uses: manyuanrong/setup-ossutil@v2.0
with:
endpoint: ${{ secrets.OSS_ENDPOINT }}
access-key-id: ${{ secrets.OSS_ACCESS_KEY_ID }}
access-key-secret: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
- name: Cat md5sum
run: cat ./sealos-cloud.tar.gz.md5
- name: Upload
run: |
ossutil cp ./sealos-cloud.tar.gz oss://${{ secrets.OSS_BUCKET }}/cloud/sealos-cloud-${{ github.event.release.tag_name }}-arm64.tar.gz
ossutil cp ./sealos-cloud.tar.gz.md5 oss://${{ secrets.OSS_BUCKET }}/cloud/sealos-cloud-${{ github.event.release.tag_name }}-arm64.tar.gz.md5
7 changes: 4 additions & 3 deletions scripts/cloud/build-offline-tar.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
set -x

ARCH=${ARCH:-"amd64"}
CLOUD_VERSION="latest"

# pull and save images
Expand All @@ -20,7 +21,7 @@ images=(
)

for image in "${images[@]}"; do
sealos pull "$image"
sealos pull --platform "linux/$ARCH" "$image"
filename=$(echo "$image" | cut -d':' -f1 | tr / -)
if [[ ! -f "output/tars/${filename}.tar" ]]; then
sealos save -o "output/tars/${filename}.tar" "$image"
Expand All @@ -33,8 +34,8 @@ mkdir -p output/cli

VERSION="v4.3.5"

wget https://github.com/labring/sealos/releases/download/${VERSION}/sealos_${VERSION#v}_linux_amd64.tar.gz \
&& tar zxvf sealos_${VERSION#v}_linux_amd64.tar.gz sealos && chmod +x sealos && mv sealos output/cli
wget https://github.com/labring/sealos/releases/download/${VERSION}/sealos_${VERSION#v}_linux_${ARCH}.tar.gz \
&& tar zxvf sealos_${VERSION#v}_linux_${ARCH}.tar.gz sealos && chmod +x sealos && mv sealos output/cli

# get and save install scripts
echo "
Expand Down

0 comments on commit b6643a4

Please sign in to comment.