diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index ecbbbb82..8aac3e3f 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -11,27 +11,55 @@ jobs: Windows-build: runs-on: windows-latest steps: - - name: Init Python 3.11.4 - uses: actions/setup-python@v4 - with: - python-version: '3.11.4' - - name: Install Dependent Packages - run: | - python -m pip install --upgrade pip - pip install wheel pyinstaller - git clone --depth=1 -b main https://github.com/jxxghp/MoviePilot - cd MoviePilot - pip install -r requirements.txt - shell: pwsh + - name: Checkout + uses: actions/checkout@v4 - - name: Pyinstaller - run: | - cd MoviePilot - pyinstaller windows.spec - shell: pwsh + - name: Release Version + id: release_version + run: | + app_version=$(cat version.py |sed -ne "s/APP_VERSION\s=\s'v\(.*\)'/\1/gp") + echo "app_version=$app_version" >> $GITHUB_ENV - - name: Upload Windows File - uses: actions/upload-artifact@v3 - with: - name: windows - path: MoviePilot/dist/MoviePilot.exe + - name: Generate Release + id: generate_release + uses: actions/create-release@latest + with: + tag_name: v${{ env.app_version }} + release_name: v${{ env.app_version }} + body: ${{ github.event.commits[0].message }} + draft: false + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Init Python 3.11.4 + uses: actions/setup-python@v4 + with: + python-version: '3.11.4' + + - name: Install Dependent Packages + run: | + python -m pip install --upgrade pip + pip install wheel pyinstaller + pip install -r requirements.txt + shell: pwsh + + - name: Pyinstaller + run: | + pyinstaller windows.spec + shell: pwsh + + - name: Upload Windows File + uses: actions/upload-artifact@v3 + with: + name: windows + path: dist/MoviePilot.exe + + - name: Upload Release Asset + uses: dwenegar/upload-release-assets@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + release_id: ${{ steps.generate_release.outputs.id }} + assets_path: | + dist/MoviePilot.exe diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index affd37c5..0b32b29d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,23 +8,20 @@ on: - version.py jobs: - build: + Docker-build: runs-on: ubuntu-latest name: Build Docker Image steps: - - - name: Checkout + - name: Checkout uses: actions/checkout@v4 - - - name: Release version + - name: Release version id: release_version run: | app_version=$(cat version.py |sed -ne "s/APP_VERSION\s=\s'v\(.*\)'/\1/gp") echo "app_version=$app_version" >> $GITHUB_ENV - - - name: Docker meta + - name: Docker meta id: meta uses: docker/metadata-action@v5 with: @@ -33,23 +30,19 @@ jobs: type=raw,value=${{ env.app_version }} type=raw,value=latest - - - name: Set Up QEMU + - name: Set Up QEMU uses: docker/setup-qemu-action@v3 - - - name: Set Up Buildx + - name: Set Up Buildx uses: docker/setup-buildx-action@v3 - - - name: Login DockerHub + - name: Login DockerHub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build Image + - name: Build Image uses: docker/build-push-action@v5 with: context: . diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 43c11bb5..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: MoviePilot Release -on: - workflow_dispatch: - push: - branches: - - main - paths: - - version.py - -jobs: - build: - runs-on: ubuntu-latest - name: Build Docker Image - steps: - - - name: Checkout - uses: actions/checkout@v4 - - - - name: Release Version - id: release_version - run: | - app_version=$(cat version.py |sed -ne "s/APP_VERSION\s=\s'v\(.*\)'/\1/gp") - echo "app_version=$app_version" >> $GITHUB_ENV - - - - name: Generate Release - uses: actions/create-release@latest - with: - tag_name: v${{ env.app_version }} - release_name: v${{ env.app_version }} - body: ${{ github.event.commits[0].message }} - draft: false - prerelease: false - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}