From e3f2765fed556345c44dcdc118f225d4f779c087 Mon Sep 17 00:00:00 2001 From: "Sijie.Sun" Date: Sat, 3 Feb 2024 01:43:33 +0800 Subject: [PATCH] Update rust.yml (#12) upload release files to aliyun oss --- .github/workflows/rust.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 40bda58..6e74bb3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -4,7 +4,7 @@ on: push: branches: [ "develop", "main" ] pull_request: - branches: [ "main" ] + branches: [ "develop", "main" ] env: CARGO_TERM_COLOR: always @@ -48,7 +48,7 @@ jobs: uses: actions/cache@v4.0.0 with: path: | - ~/.cargo/registry + ~/.cargo ./target key: build-cargo-registry-${{matrix.TARGET}} - name: Install rust target @@ -74,7 +74,7 @@ jobs: fi mv ./target/$TARGET/release/easytier-core"$SUFFIX" ./artifacts/objects/ mv ./target/$TARGET/release/easytier-cli"$SUFFIX" ./artifacts/objects/ - tar -cvf ./artifacts/$NAME-$TARGET-$TAG.tar ./artifacts/objects/* + tar -cvf ./artifacts/$NAME-$TARGET-$TAG.tar -C ./artifacts/objects/ . rm -rf ./artifacts/objects/ - name: Archive artifact uses: actions/upload-artifact@v4 @@ -82,6 +82,18 @@ jobs: name: easytier-${{ matrix.OS }}-${{ matrix.TARGET }} path: | ./artifacts/* + - name: Upload OSS + uses: Menci/upload-to-oss@main + with: + access-key-id: ${{ secrets.ALIYUN_OSS_ACCESS_ID }} + access-key-secret: ${{ secrets.ALIYUN_OSS_ACCESS_KEY }} + endpoint: ${{ secrets.ALIYUN_OSS_ENDPOINT }} + bucket: ${{ secrets.ALIYUN_OSS_BUCKET }} + local-path: ./artifacts/ + remote-path: /easytier-releases/${{ github.sha }}/ + no-delete-remote-files: true + retry: 5 + increment: true test: runs-on: ubuntu-latest steps: @@ -101,7 +113,7 @@ jobs: uses: actions/cache@v4.0.0 with: path: | - ~/.cargo/registry + ~/.cargo ./target key: build-cargo-registry-test - name: Run tests