aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/nightly.yml
blob: 215f5f255f12440942333a38a5f6957136b90c92 (plain)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Nightly

on:
  workflow_dispatch:
  schedule:
    - cron: '53 7 * * *'

permissions:
  contents: read

jobs:
  linux:

    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v6

    - name: Install ghc
      run: |
        ghcup install ghc --set 9.8
        ghcup install cabal --set 3.14

    - name: Install dependencies
      run: |
          ghc --version
          cabal --version
          cabal update
          cabal build --dependencies-only -fembed_data_files -fnightly pandoc-cli
    - name: Build and install artifact
      run: |
          export ARTIFACTS=nightly-linux/pandoc-nightly-linux-$(date +%Y-%m-%d)
          mkdir -p ${ARTIFACTS}
          cabal install --installdir="${ARTIFACTS}" --install-method=copy -fembed_data_files -fnightly pandoc-cli
          strip "${ARTIFACTS}/pandoc"
          cp COPYRIGHT ${ARTIFACTS}/
          echo "Built from ${GITHUB_SHA}" > ${ARTIFACTS}/README.nightly.txt
    - uses: actions/upload-artifact@v5
      with:
        name: nightly-linux
        path: nightly-linux

  windows:

    runs-on: windows-2022

    steps:
    - uses: actions/checkout@v6
    - name: Install ghc
      run: |
        ghcup install ghc --set 9.8
        ghcup install cabal --set 3.14
    - name: Install dependencies
      run: |
          cabal update
          cabal build --dependencies-only -fembed_data_files -fnightly pandoc-cli
    - name: Build artifacts
      shell: cmd
      run: |
          for /f %%a in ('powershell -Command "Get-Date -format yyyy-MM-dd"') do set THEDATE=%%a
          set ARTIFACTS=%CD%\nightly-windows\pandoc-nightly-windows-%THEDATE%
          mkdir %ARTIFACTS%
          cabal install --install-method=copy --installdir=%ARTIFACTS% -fnightly -fembed_data_files pandoc-cli
          strip %ARTIFACTS%/pandoc
          copy COPYRIGHT %ARTIFACTS%
          ren %ARTIFACTS%\COPYRIGHT COPYRIGHT.txt
          echo Built from %GITHUB_SHA% > %ARTIFACTS%\README.nightly.txt
    - uses: actions/upload-artifact@v5
      with:
        name: nightly-windows
        path: nightly-windows

  macos:

    runs-on: macos-13

    steps:
    - uses: actions/checkout@v6
    - name: Install ghcup
      run: |
        brew install ghcup
    - name: Install ghc
      run: |
        ghcup install ghc --set 9.8
        ghcup install cabal --set 3.14
        echo "$HOME/.ghcup/bin" >> "${GITHUB_PATH}"
    - name: Install dependencies
      run: |
          cabal update
          cabal build --dependencies-only -fnightly -fembed_data_files pandoc-cli
    - name: Build artifacts
      run: |
          export ARTIFACTS=nightly-macos/pandoc-nightly-macos-$(date +%Y-%m-%d)
          mkdir -p ${ARTIFACTS}
          cabal install --install-method=copy --installdir="${ARTIFACTS}" -fnightly -fembed_data_files pandoc-cli
          strip "${ARTIFACTS}/pandoc"
          cp COPYRIGHT ${ARTIFACTS}/
          echo "Built from ${GITHUB_SHA}" > ${ARTIFACTS}/README.nightly.txt
    - uses: actions/upload-artifact@v5
      with:
        name: nightly-macos
        path: nightly-macos