Assetbrowser v3 (#20) #33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "ci" | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| workflow_dispatch: | |
| inputs: | |
| release_tag: | |
| description: "Release tag" | |
| required: true | |
| type: string | |
| default: "latest" | |
| env: | |
| BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
| RELEASE_TAG: ${{ inputs.release_tag || 'latest' }} | |
| jobs: | |
| windows-pre-release: | |
| name: "Windows Pre-release" | |
| runs-on: "windows-latest" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/build | |
| - name: Detecting version | |
| id: vars | |
| shell: bash | |
| run: | | |
| echo "version_tag=$(python3 ./ci/printversion.py)" >> $GITHUB_OUTPUT | |
| - name: Print version | |
| run: echo "${{ steps.vars.outputs.version_tag }}" | |
| - name: install pip-licenses | |
| run: python3 -m pip install --upgrade pip-licenses | |
| - name: collect licenses | |
| run: | | |
| python3 ./ci/collect_licenses.py --output-dir licenses | |
| - name: install pyinstaller | |
| run: pip install --upgrade pyinstaller | |
| - name: create versionfiles | |
| run: | | |
| python3 ./ci/versionfile_gen.py ./ci/versionfile_cli.txt preppipe_cli.exe --cli | |
| python3 ./ci/versionfile_gen.py ./ci/versionfile_gui.txt preppipe.exe | |
| - name: run pyinstaller | |
| run: pyinstaller --log-level DEBUG ci/preppipe.spec | |
| - name: build package | |
| shell: bash | |
| run: | | |
| mv licenses dist/preppipe | |
| cd dist/preppipe && 7z.exe a -t7z -mx=9 ../preppipe-windows-x64.7z * && cd ../.. | |
| - uses: "marvinpinto/action-automatic-releases@latest" | |
| with: | |
| repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
| automatic_release_tag: "${{ env.RELEASE_TAG }}" | |
| prerelease: true | |
| title: "${{ steps.vars.outputs.version_tag }} 最新版本 (Latest build) - ${{ env.BRANCH_NAME }}" | |
| files: | | |
| dist/preppipe-windows-x64.7z | |
| dist/*.whl | |
| asset-related: | |
| name: "Full CI with assets" | |
| runs-on: "ubuntu-latest" | |
| needs: windows-pre-release | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: "Download assets" | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: "PrepPipe/preppipe-assets" | |
| ref: "main" | |
| path: assets | |
| - uses: ./.github/actions/build | |
| - name: build assets | |
| run: python3 -X utf8 ./build_assets.py --export-built-embedded src/preppipe/assets/_install | |
| shell: bash | |
| - name: create asset pack | |
| shell: bash | |
| run: | | |
| mkdir -p dist | |
| cd src && 7z a -t7z -mx=9 ../dist/builtin-assets-packed.7z -v2000m preppipe/assets/_install/* | |
| - name: generate documentation files | |
| run: | | |
| python3 ci/mkdocsgen.py | |
| cd docs_mkdocs && 7z a -t7z -mx=9 ../dist/preppipe-docs-overlay.7z -v2000m docs && cd .. | |
| - name: "Upload files" | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ github.token }} # required for gh release | |
| run: | | |
| gh release upload "${{ env.RELEASE_TAG }}" dist/builtin-assets-packed.7z.* --clobber | |
| gh release upload "${{ env.RELEASE_TAG }}" dist/preppipe-docs-overlay.7z.* --clobber |