diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..728f8e5fea --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,43 @@ +name: build installer + +on: + workflow_dispatch: + workflow_call: + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 5 # expected run time: <2 min + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: setup python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + cache: pip + cache-dependency-path: pyproject.toml + + - name: install pypa/build + run: pip install --upgrade build + + - name: setup frontend + uses: ./.github/actions/install-frontend-deps + + - name: create installer + id: create_installer + run: ./create_installer.sh + working-directory: installer + + - name: upload python distribution artifact + uses: actions/upload-artifact@v4 + with: + name: dist + path: ${{ steps.create_installer.outputs.DIST_PATH }} + + - name: upload installer artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.create_installer.outputs.INSTALLER_FILENAME }} + path: ${{ steps.create_installer.outputs.INSTALLER_PATH }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bce20d15af..6e7a689629 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,44 +5,9 @@ on: tags: - 'v*' workflow_dispatch: - inputs: - skip_code_checks: - description: 'Skip code checks (disables publish)' - required: true - default: true - type: boolean jobs: - frontend-checks: - if: github.event.inputs.skip_code_checks != 'true' - runs-on: ubuntu-latest - steps: - - name: run-frontend-checks - uses: ./.github/workflows/frontend-checks.yml - - frontend-tests: - if: github.event.inputs.skip_code_checks != 'true' - runs-on: ubuntu-latest - steps: - - name: run-frontend-tests - uses: ./.github/workflows/frontend-tests.yml - - python-checks: - if: github.event.inputs.skip_code_checks != 'true' - runs-on: ubuntu-latest - steps: - - name: run-python-checks - uses: ./.github/workflows/python-checks.yml - - python-tests: - if: github.event.inputs.skip_code_checks != 'true' - runs-on: ubuntu-latest - steps: - - name: run-python-tests - uses: ./.github/workflows/python-tests.yml - check-version: - if: github.event.inputs.skip_code_checks != 'true' runs-on: ubuntu-latest steps: - name: checkout @@ -54,45 +19,36 @@ jobs: with: version_file_path: invokeai/version/invokeai_version.py + frontend-checks: + needs: check-version + uses: ./.github/workflows/frontend-checks.yml + + frontend-tests: + needs: check-version + uses: ./.github/workflows/frontend-tests.yml + + python-checks: + needs: check-version + uses: ./.github/workflows/python-checks.yml + + python-tests: + needs: check-version + uses: ./.github/workflows/python-tests.yml + build: - runs-on: ubuntu-latest - timeout-minutes: 15 # expected run time: <10 min - steps: - - name: checkout - uses: actions/checkout@v4 - - - name: setup python - uses: actions/setup-python@v5 - with: - python-version: '3.10' - cache: pip - cache-dependency-path: pyproject.toml - - - name: install pypa/build - run: pip install --upgrade build - - - name: setup frontend - uses: ./.github/actions/install-frontend-deps - - - name: create installer - id: create_installer - run: ./create_installer.sh - working-directory: installer - - - name: upload python distribution artifact - uses: actions/upload-artifact@v4 - with: - name: dist - path: ${{ steps.create_installer.outputs.DIST_PATH }} - - - name: upload installer artifact - uses: actions/upload-artifact@v4 - with: - name: ${{ steps.create_installer.outputs.INSTALLER_FILENAME }} - path: ${{ steps.create_installer.outputs.INSTALLER_PATH }} + needs: + [ + check-version, + frontend-checks, + frontend-tests, + python-checks, + python-tests, + ] + uses: ./.github/workflows/build.yml publish-testpypi: runs-on: ubuntu-latest + timeout-minutes: 5 # expected run time: <1 min needs: [ check-version, @@ -102,7 +58,6 @@ jobs: python-tests, build, ] - if: github.event_name != 'workflow_dispatch' environment: name: testpypi url: https://test.pypi.org/p/invokeai @@ -120,6 +75,7 @@ jobs: publish-pypi: runs-on: ubuntu-latest + timeout-minutes: 5 # expected run time: <1 min needs: [ check-version, @@ -129,7 +85,6 @@ jobs: python-tests, build, ] - if: github.event_name != 'workflow_dispatch' environment: name: pypi url: https://pypi.org/p/invokeai