Debian Codegraph @

.github/workflows/build.yml

raw
1 name: Build, Test and Publish
2 on:
3 push:
4 branches-ignore:
5 - trunk
6 - svn2git-cache
7 pull_request:
8 jobs:
9 build:
10 strategy:
11 fail-fast: false
12 matrix:
13 python-version: ['3.x'] # 2.x is supported but EOL on GitHub Actions
14 os: [ubuntu-22.04, ubuntu-24.04, macos-14, macos-15, macos-latest, windows-2022, windows-2025]
15 log: [yes, no]
16 include:
17 - nightly: nightly
18 os: windows-2022
19 log: no
20 python-version: 3.x
21
22 runs-on: ${{ matrix.os }}
23 steps:
24 - name: Checkout
25 uses: actions/checkout@v6
26 - name: Brew Dependencies
27 run: |
28 brew install scons mingw-w64 zlib
29 curl --retry 9 -sLo cppunit.rb "https://sourceforge.net/p/nsis/code/HEAD/tree/web-scripts/trunk/cppunit.rb?format=raw"
30 HOMEBREW_DEVELOPER=true brew install -s --formula cppunit.rb
31 if: startsWith(matrix.os, 'macos')
32 - name: Apt Dependencies
33 run: sudo DEBIAN_FRONTEND=noninteractive apt-get install -y scons g++-mingw-w64-i686 binutils-mingw-w64-i686 zlib1g-dev libcppunit-dev
34 if: startsWith(matrix.os, 'ubuntu')
35 - name: Setup Python
36 uses: actions/setup-python@v6
37 with:
38 python-version: ${{ matrix.python-version }}
39 if: startsWith(matrix.os, 'windows')
40 - name: Choco Dependencies
41 run: |
42 curl --retry 9 -sLo cppunit-msvc-1.12.1.exe https://downloads.sourceforge.net/project/cppunit-msvc/cppunit-msvc-1.12.1.exe
43 $arguments = "/S /D=$HOME\cppunit"
44 Start-Process ./cppunit-msvc-1.12.1.exe $arguments -NoNewWindow -Wait
45 pip install scons
46 choco install zip
47 # microsoft removed the download of htmlhelp.exe -- https://chocolatey.org/packages/html-help-workshop#comment-5245282888
48 #choco install html-help-workshop
49 echo "${Env:ProgramFiles(x86)}\HTML Help Workshop" >> $Env:GITHUB_PATH
50 if: startsWith(matrix.os, 'windows')
51 - name: Zlib Dependency
52 run: |
53 curl --retry 9 -sLo $HOME/zlib.zip "https://downloads.sourceforge.net/project/libpng/zlib/1.2.8/zlib128-dll.zip?r=&ts=1403402496&use_mirror=hivelocity"
54 mkdir -p $HOME/zlib
55 unzip -o $HOME/zlib.zip -d $HOME/zlib
56 - name: Build (Linux)
57 run: |
58 scons ZLIB_W32=$HOME/zlib SKIPUTILS="NSIS Menu" NSIS_CONFIG_LOG=${{ matrix.log }} test dist-zip
59 if: startsWith(matrix.os, 'ubuntu')
60 - name: Build (MacOS)
61 run: |
62 scons ZLIB_W32=$HOME/zlib SKIPUTILS="NSIS Menu" NSIS_CONFIG_LOG=${{ matrix.log }} APPEND_CPPPATH=/opt/homebrew/include APPEND_LIBPATH=/opt/homebrew/lib test dist-zip
63 if: startsWith(matrix.os, 'macos')
64 - name: Build (Windows)
65 run: |
66 scons ZLIB_W32=$HOME/zlib SKIPUTILS="NSIS Menu" NSIS_CONFIG_LOG=${{ matrix.log }} APPEND_CPPPATH=$HOME/cppunit/include APPEND_LIBPATH=$HOME/cppunit/lib/release-win32 test dist
67 if: startsWith(matrix.os, 'windows')
68 - name: Config Errors
69 if: ${{ failure() }}
70 run: cat config.log
71 - name: Nightly Build
72 run: |
73 rm nsis-*.zip
74 scons ZLIB_W32=$HOME/zlib SKIPUTILS="NSIS Menu" DOCTYPES=web dist-zip
75 echo https://github.com/$Env:GITHUB_REPOSITORY/actions/runs/$Env:GITHUB_RUN_ID > build.log
76 ls -Name nsis-*.zip -OutVariable zip
77 zip $zip build.log
78 if: matrix.nightly == 'nightly' && github.ref == 'refs/heads/master'
79 - name: Upload Artifact
80 uses: actions/upload-artifact@v7
81 with:
82 name: build.zip
83 path: nsis-*.zip
84 if: matrix.nightly == 'nightly' && github.ref == 'refs/heads/master'
85
86 nightly:
87 if: github.ref == 'refs/heads/master'
88 runs-on: ubuntu-22.04
89 needs: [build]
90 steps:
91 - name: Download a single artifact
92 uses: actions/download-artifact@v8
93 with:
94 name: build.zip
95 - name: Upload to SourceForge
96 run: |
97 echo "$DEPLOY_KEY" > $HOME/deploy_key
98 set -ex
99 chmod 600 $HOME/deploy_key
100 mkdir nightly
101 unzip nsis-*.zip -d nightly
102 LocalNightly=`ls -d nightly/nsis-*`
103 RemoteNightly=kichik,[email protected]:/home/project-web/nsis/htdocs/nightly
104 scp -oStrictHostKeyChecking=no -oBatchMode=yes -i $HOME/deploy_key nsis-*.zip $RemoteNightly/nsis.zip
105 scp -oStrictHostKeyChecking=no -oBatchMode=yes -i $HOME/deploy_key nightly/build.log $RemoteNightly/build.log
106 cp $LocalNightly/Docs/Contents.html $LocalNightly/Docs/index.html
107 echo "Options +indexes" > $LocalNightly/Docs/.htaccess
108 echo "Options +indexes" > $LocalNightly/Examples/.htaccess
109 echo "Options +indexes" > $LocalNightly/Include/.htaccess
110 echo "Options +indexes" > $LocalNightly/Contrib/.htaccess
111 rsync -e "ssh -i $HOME/deploy_key -oStrictHostKeyChecking=no -oBatchMode=yes" -va --delete $LocalNightly/Docs/ $RemoteNightly/Docs/
112 rsync -e "ssh -i $HOME/deploy_key -oStrictHostKeyChecking=no -oBatchMode=yes" -va --delete $LocalNightly/Examples/ $RemoteNightly/Examples/
113 rsync -e "ssh -i $HOME/deploy_key -oStrictHostKeyChecking=no -oBatchMode=yes" -va --delete $LocalNightly/Include/ $RemoteNightly/Include/
114 rsync -e "ssh -i $HOME/deploy_key -oStrictHostKeyChecking=no -oBatchMode=yes" -va --delete $LocalNightly/Contrib/ $RemoteNightly/Contrib/
115 env:
116 DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}