From 444d8981513f6ca9e8dd0a11bf43fd45c909cbf7 Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Fri, 11 Aug 2023 11:54:53 +0800 Subject: [PATCH] support dev artifacts --- .github/workflows/upload_artifact.yml | 2 +- .github/workflows/upload_test_artifact.yml | 70 ++++++++++++++++++++++ 2 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/upload_test_artifact.yml diff --git a/.github/workflows/upload_artifact.yml b/.github/workflows/upload_artifact.yml index 776e9a8b..3d777435 100644 --- a/.github/workflows/upload_artifact.yml +++ b/.github/workflows/upload_artifact.yml @@ -62,7 +62,7 @@ jobs: title: Release-v${{ env.VERSION }} body: ${{ steps.update_data.outputs.CHANGELOG }} draft: false - prerelease: true + prerelease: false # - name: Commit and push changes # uses: stefanzweifel/git-auto-commit-action@v4 diff --git a/.github/workflows/upload_test_artifact.yml b/.github/workflows/upload_test_artifact.yml new file mode 100644 index 00000000..8e0cadbf --- /dev/null +++ b/.github/workflows/upload_test_artifact.yml @@ -0,0 +1,70 @@ +name: upload_artifact + +on: + workflow_dispatch: + push: + branches: [main] + paths: + - "version.json" + +jobs: + upload_artifact: + name: Bupload_artifact + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + name: Check out code + + - name: Read Plugin Version + id: update_data + run: | + version=$(jq -r '.VERSION' version.json) + echo version=$version + echo "VERSION=$version" >> $GITHUB_ENV + changelog=$(cat changelog_latest.md) + echo "CHANGELOG<> $GITHUB_OUTPUT + echo "$changelog" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + mkdir websoft9 artifacts + cp -r docker websoft9 + cp -r cockpit websoft9 + cp -r scripts websoft9 + cp -r install websoft9 + cp -r docs websoft9 + cp *.md websoft9 + cp version.json websoft9 + zip -r websoft9-$version.zip websoft9 + cp websoft9-$version.zip artifacts + cp install/install.sh artifacts + cp install/update.sh artifacts + cp version.json artifacts + cp CHANGELOG.md artifacts + cp artifacts/websoft9-$version.zip artifacts/websoft9-latest.zip + + - name: Upload To Azure Blob + uses: LanceMcCarthy/Action-AzureBlobUpload@v2 + with: + connection_string: ${{ secrets.AZURE_STORAGE_ARTIFACT }} + container_name: dev + source_folder: artifacts/ + destination_folder: ./websoft9 + delete_if_exists: true + fail_if_source_empty: true + + - name: Create Release + id: create_release + uses: softprops/action-gh-release@v1 + with: + files: /* + tag_name: v${{ env.VERSION }}-dev + title: Release-v${{ env.VERSION }}-dev + body: ${{ steps.update_data.outputs.CHANGELOG }} + draft: false + prerelease: true + + # - name: Commit and push changes + # uses: stefanzweifel/git-auto-commit-action@v4 + # with: + # commit_message: Push to github main