Skip to content

Commit

Permalink
Split GitHub build workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
vkbo committed Jul 4, 2024
1 parent 60169b9 commit 140b22d
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 131 deletions.
131 changes: 0 additions & 131 deletions .github/workflows/build.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/build_assets.yml
Original file line number Diff line number Diff line change
@@ -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
43 changes: 43 additions & 0 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
@@ -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
64 changes: 64 additions & 0 deletions .github/workflows/build_mac.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 140b22d

Please sign in to comment.