From 140b22dc63c0b353da172e05762209ab5adeec6f Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Thu, 4 Jul 2024 16:42:46 +0200 Subject: [PATCH 1/2] Split GitHub build workflows --- .github/workflows/build.yml | 131 ----------------------------- .github/workflows/build_assets.yml | 41 +++++++++ .github/workflows/build_linux.yml | 43 ++++++++++ .github/workflows/build_mac.yml | 64 ++++++++++++++ 4 files changed, 148 insertions(+), 131 deletions(-) delete mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/build_assets.yml create mode 100644 .github/workflows/build_linux.yml create mode 100644 .github/workflows/build_mac.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 79407646e..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,131 +0,0 @@ -name: Build - -on: workflow_dispatch - -jobs: - buildAssets: - runs-on: ubuntu-latest - steps: - - name: Python Setup - uses: actions/setup-python@v5 - with: - python-version: "3.12" - architecture: x64 - - - name: Install Packages (apt) - run: | - sudo apt update - sudo apt install qttools5-dev-tools latexmk texlive texlive-latex-extra - - - name: Checkout Source - uses: actions/checkout@v4 - - - name: Install Packages (pip) - run: pip install -r docs/source/requirements.txt - - - name: Build Assets - run: python pkgutils.py qtlrelease sample manual - - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: nw-assets - path: | - novelwriter/assets/sample.zip - novelwriter/assets/manual.pdf - novelwriter/assets/i18n/*.qm - if-no-files-found: error - retention-days: 14 - - buildLinux: - needs: buildAssets - runs-on: ubuntu-latest - env: - PYTHON_VERSION: "3.12" - LINUX_TAG: "manylinux_2_28_x86_64" - steps: - - name: Python Setup - uses: actions/setup-python@v5 - with: - python-version: "3.11" - architecture: x64 - - - name: Install Packages (pip) - run: pip install python-appimage - - - name: Checkout Source - uses: actions/checkout@v4 - - - name: Download Artifacts - uses: actions/download-artifact@v4 - with: - name: nw-assets - path: novelwriter/assets - - - name: Build AppImage - run: python pkgutils.py build-appimage --linux-tag $LINUX_TAG --python-version $PYTHON_VERSION - - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: Linux-AppImage - path: dist_appimage - if-no-files-found: error - retention-days: 14 - - buildMac-AMD64: - needs: buildAssets - # Stay on macos-12 due to https://github.com/create-dmg/create-dmg/issues/143 - runs-on: macos-12 - env: - PYTHON_VERSION: "3.12" - PACKAGE_ARCH: x86_64 - MINICONDA_ARCH: x86_64 - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Download Artifacts - uses: actions/download-artifact@v4 - with: - name: nw-assets - path: novelwriter/assets - - - name: Build App Bundle - run: ./setup/macos/build.sh $PYTHON_VERSION $PACKAGE_ARCH $MINICONDA_ARCH - - - name: Upload DMG - uses: actions/upload-artifact@v4 - with: - name: MacOS-AMD64-DMG - path: dist_macos - if-no-files-found: error - retention-days: 14 - - buildMac-M1: - needs: buildAssets - runs-on: macos-14 - env: - PYTHON_VERSION: "3.12" - PACKAGE_ARCH: aarch64 - MINICONDA_ARCH: arm64 - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Download Artifacts - uses: actions/download-artifact@v4 - with: - name: nw-assets - path: novelwriter/assets - - - name: Build App Bundle - run: ./setup/macos/build.sh $PYTHON_VERSION $PACKAGE_ARCH $MINICONDA_ARCH - - - name: Upload DMG - uses: actions/upload-artifact@v4 - with: - name: MacOS-M1-DMG - path: dist_macos - if-no-files-found: error - retention-days: 14 diff --git a/.github/workflows/build_assets.yml b/.github/workflows/build_assets.yml new file mode 100644 index 000000000..05579f596 --- /dev/null +++ b/.github/workflows/build_assets.yml @@ -0,0 +1,41 @@ +name: BuildAssets + +on: workflow_call + +jobs: + buildAssets: + runs-on: ubuntu-latest + steps: + - name: Python Setup + uses: actions/setup-python@v5 + with: + python-version: "3.12" + architecture: x64 + + - name: Install Packages (apt) + run: | + sudo apt update + sudo apt install qttools5-dev-tools latexmk texlive texlive-latex-extra + + - name: Checkout Source + uses: actions/checkout@v4 + + - name: Install Packages (pip) + run: pip install -r docs/source/requirements.txt + + - name: Build Assets + run: | + python pkgutils.py manual + python pkgutils.py sample + python pkgutils.py qtlrelease + + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: nw-assets + path: | + novelwriter/assets/manual.pdf + novelwriter/assets/sample.zip + novelwriter/assets/i18n/*.qm + if-no-files-found: error + retention-days: 14 diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml new file mode 100644 index 000000000..e6c8705ac --- /dev/null +++ b/.github/workflows/build_linux.yml @@ -0,0 +1,43 @@ +name: BuildLinux + +on: workflow_dispatch + +jobs: + buildAssets: + uses: ./.github/workflows/build_assets.yml + + buildLinux: + needs: buildAssets + runs-on: ubuntu-latest + env: + PYTHON_VERSION: "3.12" + LINUX_TAG: "manylinux_2_28_x86_64" + steps: + - name: Python Setup + uses: actions/setup-python@v5 + with: + python-version: "3.11" + architecture: x64 + + - name: Install Packages (pip) + run: pip install python-appimage + + - name: Checkout Source + uses: actions/checkout@v4 + + - name: Download Artifacts + uses: actions/download-artifact@v4 + with: + name: nw-assets + path: novelwriter/assets + + - name: Build AppImage + run: python pkgutils.py build-appimage --linux-tag $LINUX_TAG --python-version $PYTHON_VERSION + + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: Linux-AppImage + path: dist_appimage + if-no-files-found: error + retention-days: 14 diff --git a/.github/workflows/build_mac.yml b/.github/workflows/build_mac.yml new file mode 100644 index 000000000..704d3e6e7 --- /dev/null +++ b/.github/workflows/build_mac.yml @@ -0,0 +1,64 @@ +name: BuildMacOS + +on: workflow_dispatch + +jobs: + buildAssets: + uses: ./.github/workflows/build_assets.yml + + buildMac-AMD64: + needs: buildAssets + # Stay on macos-12 due to https://github.com/create-dmg/create-dmg/issues/143 + runs-on: macos-12 + env: + PYTHON_VERSION: "3.12" + PACKAGE_ARCH: x86_64 + MINICONDA_ARCH: x86_64 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Download Artifacts + uses: actions/download-artifact@v4 + with: + name: nw-assets + path: novelwriter/assets + + - name: Build App Bundle + run: ./setup/macos/build.sh $PYTHON_VERSION $PACKAGE_ARCH $MINICONDA_ARCH + + - name: Upload DMG + uses: actions/upload-artifact@v4 + with: + name: MacOS-AMD64-DMG + path: dist_macos + if-no-files-found: error + retention-days: 14 + + buildMac-M1: + needs: buildAssets + runs-on: macos-14 + env: + PYTHON_VERSION: "3.12" + PACKAGE_ARCH: aarch64 + MINICONDA_ARCH: arm64 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Download Artifacts + uses: actions/download-artifact@v4 + with: + name: nw-assets + path: novelwriter/assets + + - name: Build App Bundle + run: ./setup/macos/build.sh $PYTHON_VERSION $PACKAGE_ARCH $MINICONDA_ARCH + + - name: Upload DMG + uses: actions/upload-artifact@v4 + with: + name: MacOS-M1-DMG + path: dist_macos + if-no-files-found: error + retention-days: 14 From e80a9824f6d70d42dfca022436448fb3935ec947 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Thu, 4 Jul 2024 16:47:39 +0200 Subject: [PATCH 2/2] Add placeholder Windows build job --- .github/workflows/build_win.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/build_win.yml diff --git a/.github/workflows/build_win.yml b/.github/workflows/build_win.yml new file mode 100644 index 000000000..c16e5340b --- /dev/null +++ b/.github/workflows/build_win.yml @@ -0,0 +1,19 @@ +name: BuildWindows + +on: workflow_dispatch + +jobs: + buildAssets: + uses: ./.github/workflows/build_assets.yml + + buildWin64: + needs: buildAssets + runs-on: windows-latest + steps: + - name: Python Setup + uses: actions/setup-python@v5 + with: + python-version: "3.12" + architecture: x64 + - name: Checkout Source + uses: actions/checkout@v4