From b9eb3d31191d4b7403dc539f2e0db82bc7ac8204 Mon Sep 17 00:00:00 2001 From: brown Date: Thu, 9 May 2024 15:02:58 +0800 Subject: [PATCH] add musl build target and upload artifact to cos --- .github/workflows/release.yaml | 130 +++++++++++++++++++++++++++++++-- 1 file changed, 122 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a56d20d..8756dda 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -87,7 +87,6 @@ jobs: retry_times: 5 storage_class: "STANDARD" - linux-arm64-build-job: runs-on: aws-arm64-runner steps: @@ -147,6 +146,7 @@ jobs: region: ap-shanghai retry_times: 5 storage_class: "STANDARD" + darwin-x86-build-job: runs-on: macos-latest @@ -154,12 +154,11 @@ jobs: # GitHub Hosted MacOS runner cannot connect to time.apple.com, so use time.windows.com - name: Sync System Time run: | - set +e; for i in {1..10}; do - sudo sntp -sS time.windows.com; - if [ "$?" == "0" ]; then + if sudo sntp -sS time.windows.com; then exit 0; fi + sleep 1; done exit 1; - name: Checkout source @@ -187,6 +186,7 @@ jobs: p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }} # The password used to import the PKCS12 file. p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }} + - name: Clone gon uses: actions/checkout@v4 with: @@ -200,6 +200,7 @@ jobs: make; chmod +x gon; echo "$(pwd)" >> $GITHUB_PATH; + - name: Code signing and app notarization env: AC_PASSWORD: ${{ secrets.AC_PASSWORD }} @@ -264,19 +265,17 @@ jobs: INPUT_SECRET_KEY: ${{ secrets.TENCENT_SK }} INPUT_STORAGE_CLASS: "STANDARD" - #if the release for darwin-arm is failed, please contact guguducken to check runner status darwin-arm-build-job: runs-on: mac-arm64-mini steps: - name: Sync system time run: | - set +e; for i in {1..10}; do - sudo sntp -sS time.apple.com; - if [ "$?" == "0" ]; then + if sudo sntp -sS time.apple.com; then exit 0; fi + sleep 1; done exit 1; - name: Checkout source @@ -373,3 +372,118 @@ jobs: run: | security list-keychains | grep sign | awk 'system("security delete-keychain "$1)' security find-identity -p codesigning | grep ID | awk 'NR=1{system("security delete-identity -Z "$2)}' + + musl-x86-build-job: + runs-on: ubuntu-20.04 + steps: + - name: Checkout source + uses: actions/checkout@v4 + - name: Get release + id: get_release + uses: bruceadams/get-release@v1.3.2 + env: + GITHUB_TOKEN: ${{ secrets.TOKEN_ACTION }} + - name: Echo some info + run: | + echo ${{ steps.get_release.outputs.upload_url }} + echo ${{ steps.get_release.outputs.tag_name }} + - name: Set up Go + uses: matrixorigin/CI/actions/setup-env@main + with: + setup-java: false + - name: Build normal + run: | + cd $GITHUB_WORKSPACE; + make musl; + # copy toml configure file + mkdir -p mo-${{ steps.get_release.outputs.tag_name }}-musl-x86_64/etc + mv mo-service mo-${{ steps.get_release.outputs.tag_name }}-musl-x86_64/ + + mv ./etc/launch mo-${{ steps.get_release.outputs.tag_name }}-musl-x86_64/etc/ + if [ -d "./etc/launch-with-python-udf-server" ]; then + mv ./etc/launch-with-python-udf-server ./mo-${{ steps.get_release.outputs.tag_name }}-musl-x86_64/etc/ + fi + if [ -d "./pkg/udf/pythonservice/pyserver" ]; then + mkdir -p mo-${{ steps.get_release.outputs.tag_name }}-musl-x86_64/pkg/udf/pythonservice + mv ./pkg/udf/pythonservice/pyserver ./mo-${{ steps.get_release.outputs.tag_name }}-musl-x86_64/pkg/udf/pythonservice + fi + zip -r mo-${{ steps.get_release.outputs.tag_name }}-musl-x86_64.zip mo-${{ steps.get_release.outputs.tag_name }}-musl-x86_64 + - name: Upload Release normal musl x86_64 + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.TOKEN_ACTION }} + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: ./mo-${{ steps.get_release.outputs.tag_name }}-musl-x86_64.zip + asset_name: mo-${{ steps.get_release.outputs.tag_name }}-musl-x86_64.zip + asset_content_type: application/zip + - name: Upload Artifact to COS + uses: matrixorigin/CI/actions/upload-artifact-oss@main + with: + access_key: ${{ secrets.TENCENT_AK }} + secret_key: ${{ secrets.TENCENT_SK }} + artifact_path: ${{ github.workspace }}/mo-${{ steps.get_release.outputs.tag_name }}-musl-x86_64.zip + bucket: ${{ secrets.RELEASE_BUCKET }} + oss_path: matrixone/${{ steps.get_release.outputs.tag_name }} + provider: cos + region: ap-shanghai + retry_times: 5 + storage_class: "STANDARD" + + + musl-arm64-build-job: + runs-on: aws-arm64-runner + steps: + - name: Checkout source + uses: actions/checkout@v4 + - name: Get release + id: get_release + uses: bruceadams/get-release@v1.3.2 + env: + GITHUB_TOKEN: ${{ secrets.TOKEN_ACTION }} + - name: Echo some info + run: | + echo ${{ steps.get_release.outputs.upload_url }} + echo ${{ steps.get_release.outputs.tag_name }} + - name: Set up Go + uses: matrixorigin/CI/actions/setup-env@main + with: + setup-java: false + - name: Build normal + run: | + cd $GITHUB_WORKSPACE; + make musl; + # copy toml configure file + mkdir -p mo-${{ steps.get_release.outputs.tag_name }}-musl-arm64/etc + mv mo-service mo-${{ steps.get_release.outputs.tag_name }}-musl-arm64/ + + mv ./etc/launch mo-${{ steps.get_release.outputs.tag_name }}-musl-arm64/etc/ + if [ -d "./etc/launch-with-python-udf-server" ]; then + mv ./etc/launch-with-python-udf-server ./mo-${{ steps.get_release.outputs.tag_name }}-musl-arm64/etc/ + fi + if [ -d "./pkg/udf/pythonservice/pyserver" ]; then + mkdir -p mo-${{ steps.get_release.outputs.tag_name }}-musl-arm64/pkg/udf/pythonservice + mv ./pkg/udf/pythonservice/pyserver ./mo-${{ steps.get_release.outputs.tag_name }}-musl-arm64/pkg/udf/pythonservice + fi + zip -r mo-${{ steps.get_release.outputs.tag_name }}-musl-arm64.zip mo-${{ steps.get_release.outputs.tag_name }}-musl-arm64 + - name: Upload Release normal musl arm64 + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.TOKEN_ACTION }} + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: ./mo-${{ steps.get_release.outputs.tag_name }}-musl-arm64.zip + asset_name: mo-${{ steps.get_release.outputs.tag_name }}-musl-arm64.zip + asset_content_type: application/zip + - name: Upload Artifact to COS + uses: matrixorigin/CI/actions/upload-artifact-oss@main + with: + access_key: ${{ secrets.TENCENT_AK }} + secret_key: ${{ secrets.TENCENT_SK }} + artifact_path: ${{ github.workspace }}/mo-${{ steps.get_release.outputs.tag_name }}-musl-arm64.zip + bucket: ${{ secrets.RELEASE_BUCKET }} + oss_path: matrixone/${{ steps.get_release.outputs.tag_name }} + provider: cos + region: ap-shanghai + retry_times: 5 + storage_class: "STANDARD"