Skip to content

Commit

Permalink
ci: cloud release add self hosted runner. (#5131)
Browse files Browse the repository at this point in the history
* cloud release add self hosted runner.

* cloud release add self hosted runner.

* fix

* fix
  • Loading branch information
lingdie authored Oct 9, 2024
1 parent 04311fd commit fdf1913
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions .github/workflows/cloud-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@ name: Release Cloud
on:
release:
types: [ published ]
workflow_dispatch:
inputs:
tag:
description: 'Tag for manual release'
required: false
default: ''

env:
# Common versions
GO_VERSION: "1.20"
DEFAULT_OWNER: "labring"
TAG: ${{ github.event.inputs.tag || github.event.release.tag_name }}

jobs:
save-sealos:
Expand All @@ -17,14 +24,14 @@ jobs:
uses: ./.github/workflows/controllers.yml
with:
push_image: true
push_image_tag: ${{ github.event.release.tag_name }}
push_image_tag: ${{ env.TAG }}
secrets: inherit

release-frontends:
uses: ./.github/workflows/frontend.yml
with:
push_image: true
push_image_tag: ${{ github.event.release.tag_name }}
push_image_tag: ${{ env.TAG }}
secrets: inherit

release-service:
Expand All @@ -33,7 +40,7 @@ jobs:
uses: ./.github/workflows/services.yml
with:
push_image: true
push_image_tag: ${{ github.event.release.tag_name }}
push_image_tag: ${{ env.TAG }}
secrets: inherit

release-cloud:
Expand All @@ -45,14 +52,14 @@ jobs:
uses: ./.github/workflows/cloud.yml
with:
push_image: true
push_image_tag: ${{ github.event.release.tag_name }}
build_from: ${{ github.event.release.tag_name }}
push_image_tag: ${{ env.TAG }}
build_from: ${{ env.TAG }}
secrets: inherit

release-amd-offline-tar:
needs:
- release-cloud
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -68,8 +75,8 @@ jobs:
sudo sealos version
- name: Build
run: |
export CLOUD_VERSION=${{ github.event.release.tag_name }}
export VERSION=${{ github.event.release.tag_name }}
export CLOUD_VERSION=${{ env.TAG }}
export VERSION=${{ env.TAG }}
export ARCH=amd64
bash ./scripts/cloud/build-offline-tar.sh
- name: Setup ossutil
Expand All @@ -82,13 +89,13 @@ 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 }}-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
ossutil cp ./sealos-cloud.tar.gz oss://${{ secrets.OSS_BUCKET }}/cloud/sealos-cloud-${{ env.TAG }}-amd64.tar.gz
ossutil cp ./sealos-cloud.tar.gz.md5 oss://${{ secrets.OSS_BUCKET }}/cloud/sealos-cloud-${{ env.TAG }}-amd64.tar.gz.md5
release-arm-offline-tar:
needs:
- release-cloud
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -104,8 +111,8 @@ jobs:
sudo sealos version
- name: Build
run: |
export CLOUD_VERSION=${{ github.event.release.tag_name }}
export VERSION=${{ github.event.release.tag_name }}
export CLOUD_VERSION=${{ env.TAG }}
export VERSION=${{ env.TAG }}
export ARCH=arm64
bash ./scripts/cloud/build-offline-tar.sh
- name: Setup ossutil
Expand All @@ -118,5 +125,5 @@ 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 }}-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
ossutil cp ./sealos-cloud.tar.gz oss://${{ secrets.OSS_BUCKET }}/cloud/sealos-cloud-${{ env.TAG }}-arm64.tar.gz
ossutil cp ./sealos-cloud.tar.gz.md5 oss://${{ secrets.OSS_BUCKET }}/cloud/sealos-cloud-${{ env.TAG }}-arm64.tar.gz.md5

0 comments on commit fdf1913

Please sign in to comment.