From 7d62a344536e026db9587da5bc0ef2693916b2b4 Mon Sep 17 00:00:00 2001 From: Shengjie Xu Date: Sun, 28 Apr 2024 10:31:56 -0400 Subject: [PATCH] Github Action: support asset building; disabled repository dispatch --- .github/actions/build/action.yml | 3 +++ .github/workflows/ci.yml | 22 ++++++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index cf069de..bf9f5ac 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -29,5 +29,8 @@ runs: - name: install run: pip install dist/*.whl shell: bash + - name: build assets + run: python3 ./build_assets.py + shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d0baf5..2338290 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,13 @@ name: "ci" +env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + on: push: branches: - "main" + - "develop" jobs: pre-release: name: "Pre Release" @@ -25,26 +29,24 @@ jobs: run: python3 ./versionfile_gen.py - name: run pyinstaller run: | - pyinstaller --collect-data preppipe --icon=preppipe.ico --version-file=versionfile.txt -n preppipe_cli-windows-x64 -F preppipe_cli.py pyinstaller --collect-data preppipe --icon=preppipe.ico --version-file=versionfile.txt -n preppipe_cli -D preppipe_cli.py cd dist/preppipe_cli && 7z.exe a -t7z -mx=9 ../preppipe_cli-windows-x64.7z * - uses: "marvinpinto/action-automatic-releases@latest" with: repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "latest" + automatic_release_tag: "latest-${{ env.BRANCH_NAME }}" prerelease: true - title: "${{ steps.vars.outputs.version_tag }} 最新版本 (Latest build)" + title: "${{ steps.vars.outputs.version_tag }} 最新版本 (Latest build) - ${{ env.BRANCH_NAME }}" files: | - dist/preppipe_cli-windows-x64.exe dist/preppipe_cli-windows-x64.7z dist/*.whl - - name: Repository Dispatch - uses: peter-evans/repository-dispatch@v2 - with: - token: ${{ secrets.PREPPIPE_ALL_IN_ONE_PAT }} - repository: PrepPipe/preppipe-latest-all-in-one - event-type: update-request + #- name: Repository Dispatch + # uses: peter-evans/repository-dispatch@v2 + # with: + # token: ${{ secrets.PREPPIPE_ALL_IN_ONE_PAT }} + # repository: PrepPipe/preppipe-latest-all-in-one + # event-type: update-request #sync2gitee: # name: "Sync to Gitee"