mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-12 16:16:55 +00:00
refactor: optimize ossutil2 installation in CI workflow
This commit is contained in:
+53
-18
@@ -265,17 +265,50 @@ jobs:
|
|||||||
path: ${{ steps.package.outputs.artifact_name }}.zip
|
path: ${{ steps.package.outputs.artifact_name }}.zip
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
|
# Install ossutil2 tool for OSS upload
|
||||||
|
- name: Install ossutil2
|
||||||
|
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "::group::Installing ossutil2"
|
||||||
|
# Download and install ossutil based on platform
|
||||||
|
if [ "${{ runner.os }}" = "Linux" ]; then
|
||||||
|
curl -o ossutil.zip https://gosspublic.alicdn.com/ossutil/v2/2.1.1/ossutil-2.1.1-linux-amd64.zip
|
||||||
|
unzip -o ossutil.zip
|
||||||
|
chmod 755 ossutil-2.1.1-linux-amd64/ossutil
|
||||||
|
sudo mv ossutil-2.1.1-linux-amd64/ossutil /usr/local/bin/
|
||||||
|
rm -rf ossutil.zip ossutil-2.1.1-linux-amd64
|
||||||
|
elif [ "${{ runner.os }}" = "macOS" ]; then
|
||||||
|
if [ "$(uname -m)" = "arm64" ]; then
|
||||||
|
curl -o ossutil.zip https://gosspublic.alicdn.com/ossutil/v2/2.1.1/ossutil-2.1.1-mac-arm64.zip
|
||||||
|
else
|
||||||
|
curl -o ossutil.zip https://gosspublic.alicdn.com/ossutil/v2/2.1.1/ossutil-2.1.1-mac-amd64.zip
|
||||||
|
fi
|
||||||
|
unzip -o ossutil.zip
|
||||||
|
chmod 755 ossutil-*/ossutil
|
||||||
|
sudo mv ossutil-*/ossutil /usr/local/bin/
|
||||||
|
rm -rf ossutil.zip ossutil-*
|
||||||
|
elif [ "${{ runner.os }}" = "Windows" ]; then
|
||||||
|
curl -o ossutil.zip https://gosspublic.alicdn.com/ossutil/v2/2.1.1/ossutil-2.1.1-windows-amd64.zip
|
||||||
|
unzip -o ossutil.zip
|
||||||
|
mv ossutil-*/ossutil.exe /usr/bin/ossutil.exe
|
||||||
|
rm -rf ossutil.zip ossutil-*
|
||||||
|
fi
|
||||||
|
echo "ossutil2 installation completed"
|
||||||
|
|
||||||
- name: Upload to Aliyun OSS
|
- name: Upload to Aliyun OSS
|
||||||
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main'
|
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main'
|
||||||
uses: JohnGuan/oss-upload-action@main
|
shell: bash
|
||||||
with:
|
env:
|
||||||
key-id: ${{ secrets.ALICLOUDOSS_KEY_ID }}
|
OSSUTIL_ACCESS_KEY_ID: ${{ secrets.ALICLOUDOSS_KEY_ID }}
|
||||||
key-secret: ${{ secrets.ALICLOUDOSS_KEY_SECRET }}
|
OSSUTIL_ACCESS_KEY_SECRET: ${{ secrets.ALICLOUDOSS_KEY_SECRET }}
|
||||||
region: oss-cn-beijing
|
OSSUTIL_ENDPOINT: https://oss-cn-beijing.aliyuncs.com
|
||||||
bucket: rustfs-artifacts
|
run: |
|
||||||
assets: |
|
echo "::group::Uploading files to OSS"
|
||||||
${{ steps.package.outputs.artifact_name }}.zip:/artifacts/rustfs/${{ steps.package.outputs.artifact_name }}.zip
|
# Upload the artifact file to two different paths
|
||||||
${{ steps.package.outputs.artifact_name }}.zip:/artifacts/rustfs/${{ steps.package.outputs.artifact_name }}.latest.zip
|
ossutil cp "${{ steps.package.outputs.artifact_name }}.zip" "oss://rustfs-artifacts/artifacts/rustfs/${{ steps.package.outputs.artifact_name }}.zip" --force
|
||||||
|
ossutil cp "${{ steps.package.outputs.artifact_name }}.zip" "oss://rustfs-artifacts/artifacts/rustfs/${{ steps.package.outputs.artifact_name }}.latest.zip" --force
|
||||||
|
echo "Successfully uploaded artifacts to OSS"
|
||||||
|
|
||||||
# Determine whether to perform GUI construction based on conditions
|
# Determine whether to perform GUI construction based on conditions
|
||||||
- name: Prepare for GUI build
|
- name: Prepare for GUI build
|
||||||
@@ -393,15 +426,17 @@ jobs:
|
|||||||
# Upload GUI to Alibaba Cloud OSS
|
# Upload GUI to Alibaba Cloud OSS
|
||||||
- name: Upload GUI to Aliyun OSS
|
- name: Upload GUI to Aliyun OSS
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
uses: JohnGuan/oss-upload-action@main
|
shell: bash
|
||||||
with:
|
env:
|
||||||
key-id: ${{ secrets.ALICLOUDOSS_KEY_ID }}
|
OSSUTIL_ACCESS_KEY_ID: ${{ secrets.ALICLOUDOSS_KEY_ID }}
|
||||||
key-secret: ${{ secrets.ALICLOUDOSS_KEY_SECRET }}
|
OSSUTIL_ACCESS_KEY_SECRET: ${{ secrets.ALICLOUDOSS_KEY_SECRET }}
|
||||||
region: oss-cn-beijing
|
OSSUTIL_ENDPOINT: https://oss-cn-beijing.aliyuncs.com
|
||||||
bucket: rustfs-artifacts
|
run: |
|
||||||
assets: |
|
echo "::group::Uploading GUI files to OSS"
|
||||||
${{ steps.build_gui.outputs.gui_artifact_name }}.zip:/artifacts/rustfs/${{ steps.build_gui.outputs.gui_artifact_name }}.zip
|
# Upload the GUI artifact file to two different paths
|
||||||
${{ steps.build_gui.outputs.gui_artifact_name }}.zip:/artifacts/rustfs/${{ steps.build_gui.outputs.gui_artifact_name }}.latest.zip
|
ossutil cp "${{ steps.build_gui.outputs.gui_artifact_name }}.zip" "oss://rustfs-artifacts/artifacts/rustfs/${{ steps.build_gui.outputs.gui_artifact_name }}.zip" --force
|
||||||
|
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:
|
merge:
|
||||||
|
|||||||
Reference in New Issue
Block a user