From 3a68060e585e5e24af59d91df4306fb98b6908b8 Mon Sep 17 00:00:00 2001 From: overtrue Date: Wed, 18 Jun 2025 20:49:25 +0800 Subject: [PATCH] fix: fix ali oss config --- .github/workflows/build.yml | 117 ++++++++++++++++++++++++++++++------ 1 file changed, 97 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6a08caba..c1a4daf8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,7 @@ on: push: branches: - main - tags: [ "v*", "*" ] + tags: ["v*", "*"] jobs: build-rustfs: @@ -15,44 +15,116 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-latest, macos-latest, windows-latest ] + os: [ubuntu-latest, macos-latest, windows-latest] variant: - - { profile: release, target: x86_64-unknown-linux-musl, glibc: "default" } - - { profile: release, target: x86_64-unknown-linux-gnu, glibc: "default" } + - { + profile: release, + target: x86_64-unknown-linux-musl, + glibc: "default", + } + - { + profile: release, + target: x86_64-unknown-linux-gnu, + glibc: "default", + } - { profile: release, target: aarch64-apple-darwin, glibc: "default" } #- { profile: release, target: aarch64-unknown-linux-gnu, glibc: "default" } - - { profile: release, target: aarch64-unknown-linux-musl, glibc: "default" } + - { + profile: release, + target: aarch64-unknown-linux-musl, + glibc: "default", + } #- { profile: release, target: x86_64-pc-windows-msvc, glibc: "default" } exclude: # Linux targets on non-Linux systems - os: macos-latest - variant: { profile: release, target: x86_64-unknown-linux-gnu, glibc: "default" } + variant: + { + profile: release, + target: x86_64-unknown-linux-gnu, + glibc: "default", + } - os: macos-latest - variant: { profile: release, target: x86_64-unknown-linux-musl, glibc: "default" } + variant: + { + profile: release, + target: x86_64-unknown-linux-musl, + glibc: "default", + } - os: macos-latest - variant: { profile: release, target: aarch64-unknown-linux-gnu, glibc: "default" } + variant: + { + profile: release, + target: aarch64-unknown-linux-gnu, + glibc: "default", + } - os: macos-latest - variant: { profile: release, target: aarch64-unknown-linux-musl, glibc: "default" } + variant: + { + profile: release, + target: aarch64-unknown-linux-musl, + glibc: "default", + } - os: windows-latest - variant: { profile: release, target: x86_64-unknown-linux-gnu, glibc: "default" } + variant: + { + profile: release, + target: x86_64-unknown-linux-gnu, + glibc: "default", + } - os: windows-latest - variant: { profile: release, target: x86_64-unknown-linux-musl, glibc: "default" } + variant: + { + profile: release, + target: x86_64-unknown-linux-musl, + glibc: "default", + } - os: windows-latest - variant: { profile: release, target: aarch64-unknown-linux-gnu, glibc: "default" } + variant: + { + profile: release, + target: aarch64-unknown-linux-gnu, + glibc: "default", + } - os: windows-latest - variant: { profile: release, target: aarch64-unknown-linux-musl, glibc: "default" } + variant: + { + profile: release, + target: aarch64-unknown-linux-musl, + glibc: "default", + } # Apple targets on non-macOS systems - os: ubuntu-latest - variant: { profile: release, target: aarch64-apple-darwin, glibc: "default" } + variant: + { + profile: release, + target: aarch64-apple-darwin, + glibc: "default", + } - os: windows-latest - variant: { profile: release, target: aarch64-apple-darwin, glibc: "default" } + variant: + { + profile: release, + target: aarch64-apple-darwin, + glibc: "default", + } # Windows targets on non-Windows systems - os: ubuntu-latest - variant: { profile: release, target: x86_64-pc-windows-msvc, glibc: "default" } + variant: + { + profile: release, + target: x86_64-pc-windows-msvc, + glibc: "default", + } - os: macos-latest - variant: { profile: release, target: x86_64-pc-windows-msvc, glibc: "default" } + variant: + { + profile: release, + target: x86_64-pc-windows-msvc, + glibc: "default", + } steps: - name: Checkout repository @@ -89,7 +161,7 @@ jobs: if: steps.cache-protoc.outputs.cache-hit != 'true' uses: arduino/setup-protoc@v3 with: - version: '31.1' + version: "31.1" repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Setup Flatc @@ -296,6 +368,12 @@ jobs: fi echo "ossutil2 installation completed" + # Set the OSS configuration + ossutil config set Region oss-cn-beijing + ossutil config set endpoint oss-cn-beijing.aliyuncs.com + ossutil config set accessKeyID ${{ secrets.ALICLOUDOSS_KEY_ID }} + ossutil config set accessKeySecret ${{ secrets.ALICLOUDOSS_KEY_SECRET }} + - name: Upload to Aliyun OSS if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' shell: bash @@ -438,10 +516,9 @@ jobs: ossutil cp "${{ steps.build_gui.outputs.gui_artifact_name }}.zip" "oss://rustfs-artifacts/artifacts/rustfs/${{ steps.build_gui.outputs.gui_artifact_name }}.latest.zip" --force echo "Successfully uploaded GUI artifacts to OSS" - merge: runs-on: ubuntu-latest - needs: [ build-rustfs ] + needs: [build-rustfs] if: startsWith(github.ref, 'refs/tags/') steps: - uses: actions/upload-artifact/merge@v4