File: make-installer-macos.yml

package info (click to toggle)
xournalpp 1.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 30,044 kB
  • sloc: cpp: 64,195; xml: 939; sh: 752; ansic: 362; python: 338; php: 74; makefile: 15
file content (73 lines) | stat: -rw-r--r-- 2,493 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Template for running MacOS release jobs

on:
  workflow_call:
    inputs:
      runner:
        type: string
        required: true
      displayed_name:
        type: string
        required: true
      head_sha:         # SHA of the commit to build. Defaults to the head of the triggering event (cf github doc.)
        type: string
        default: ''
      build_type:
        type: string
        default: 'RelWithDebInfo'
      extra_cmake_flags:
        type: string
        default: ''
      artifact_version_suffix:  # Additional version string appended to 1.2.3+dev (for instance) in artifacts names
        type: string
        default: ''
    outputs:
      link:
        description: URL of the produced installer
        value: ${{ jobs.release-macos.outputs.link }}

jobs:
  release-macos:
    name: Create installer for ${{ inputs.displayed_name }}
    runs-on: ${{ inputs.runner }}
    outputs:
      link: ${{ steps.publish.outputs.artifact-url }}
    steps:
      - name: 'Checkout repository'
        uses: actions/checkout@v4
        with:
          ref: ${{ inputs.head_sha }}
      - name: 'Install dependencies'
        uses: ./.github/actions/install_deps_mac
        with:
          install_path: $HOME
      - name: 'Build Xournal++'
        uses: ./.github/actions/build
        with:
          build_type: ${{ inputs.build_type }}
          cmake_flags: >-
            -DCMAKE_INSTALL_PREFIX="$HOME/gtk/inst"
          extra_cmake_flags: ${{ inputs.extra_cmake_flags }}
      - name: 'Create installer'
        id: create-installer
        shell: bash
        run: |
          which pkg-config
          pkg-config --version
          (cd build && cmake --build . --target install)
          (cd mac-setup && ./build-app.sh $HOME/gtk)                    # populates a folder mac-setup/Xournal++.app

          export VERSION=$(cat build/VERSION | sed '1q;d')
          export OUTPUT="xournalpp-$VERSION${{ inputs.artifact_version_suffix }}-macOS-${{runner.arch}}.dmg"

          (cd mac-setup && ./build-dmg.sh Xournal++.app $OUTPUT)  # makes an installer out of this folder

          echo "artifact=$OUTPUT" >> $GITHUB_OUTPUT
      - name: 'Publish package'
        id: publish
        uses: actions/upload-artifact@v4
        with:
          name: "MacOS package ${{runner.os}}-${{runner.arch}}"
          compression-level: 0
          path: "${{github.workspace}}/mac-setup/${{ steps.create-installer.outputs.artifact }}"
          if-no-files-found: error