Skip to content

Commit 5f15d48

Browse files
authored
Build Windows Installer in CI (#13)
This PR is adding to the CI pipeline the step required to build the Windows installer. In this way a new GH release can be created much more easily, but just attaching binaries coming from the CI.
1 parent cf74f61 commit 5f15d48

File tree

7 files changed

+69
-9
lines changed

7 files changed

+69
-9
lines changed

.github/workflows/main.yml

+34-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
branches: [ master ]
77
pull_request:
88
branches: [ master ]
9+
# add a cron job to run every month -- this project is not very active, at least ensure there's a valid CI build every month
10+
# this is also useful to check if something breaks e.g. due to infrastructure changes (e.g. Ubuntu/Windows OS)
11+
schedule:
12+
- cron: '0 0 1 * *'
913

1014
jobs:
1115
LinuxBuild:
@@ -27,6 +31,7 @@ jobs:
2731
with:
2832
name: NetlistViewer, Linux x86_64
2933
path: NetlistViewer/build/linux/NetlistViewer
34+
if-no-files-found: error
3035

3136
WindowsBuild:
3237
runs-on: windows-latest
@@ -39,7 +44,7 @@ jobs:
3944
# NOTE: no packages/dependencies are installed at this time -- msbuild will use vcpkg to download&build dependencies
4045
# specified in the vcpkg.json during the build step below. This happens because the VisualStudio solution has
4146
# the 'VcpkgEnableManifest' property set to True
42-
- name: Setup anew (or from cache) vcpkg (and does not build any package)
47+
- name: Setup a new (or from cache) vcpkg (and does not build any package)
4348
uses: lukka/run-vcpkg@v11.5
4449
with:
4550
# as suggested, we pin the version of "vcpkg" to a specific hash (23rd March 2025) to ensure reproducible builds
@@ -55,9 +60,36 @@ jobs:
5560
- name: Build netlist-viewer
5661
run: msbuild NetlistViewer\build\win\netlist_viewer_vs2022.vcxproj -t:rebuild -property:Configuration=Release -property:Platform=x64
5762

58-
# save the whole folder containing the binary and DLLs
63+
# save the whole folder containing the binary and DLLs as workflow artifact
5964
- name: Save built binaries
6065
uses: actions/upload-artifact@v4
6166
with:
6267
name: NetlistViewer, Windows x86_64
6368
path: NetlistViewer/build/win/x64/Release/
69+
if-no-files-found: error
70+
71+
# snippet of actions taken from https://github.com/NSIS-Dev/ci-examples/blob/main/.github/workflows/windows-latest.yml
72+
- name: Install NSIS
73+
run: |
74+
iwr -useb get.scoop.sh -outfile 'install.ps1'
75+
.\install.ps1 -RunAsAdmin
76+
scoop update
77+
scoop bucket add extras
78+
scoop install nsis
79+
- name: Print NSIS version
80+
run: makensis -VERSION
81+
- name: Print NSIS compile flags
82+
run: makensis -HDRINFO
83+
84+
# now build the actual Windows installer:
85+
- name: Run NSIS
86+
run: makensis /V2 setup.nsi
87+
working-directory: NetlistViewer/distrib
88+
89+
# save the whole folder containing the binary and DLLs as workflow artifact
90+
- name: Save built installer
91+
uses: actions/upload-artifact@v4
92+
with:
93+
name: NetlistViewer, Windows Installer
94+
path: NetlistViewer/distrib/NetlistViewer-*-win-installer.exe
95+
if-no-files-found: error

NetlistViewer/build/linux/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ Then just run
1919
$ NetlistViewer
2020
```
2121

22+
NOTE: these steps are also part of the CI pipeline of the Github project.

NetlistViewer/build/win/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ NOTE: as of Nov 2023, the installation through vcpkg of the "expat" library (one
3030
fail due to https://github.com/libexpat/libexpat/issues/418 if you have a localized version of VisualStudio.
3131
Check that URL for the workaround (i.e. installing the English pack in VisualStudio)
3232

33+
NOTE: these steps are also part of the CI pipeline of the Github project.
3334

3435
## Update the build system
3536

NetlistViewer/distrib/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
1. Compile the distrib\setup.nsi with NSIS
66
Note that you can also use the build_installers.bat batch file to do this step automatically.
77
1. Attach the installer to the new Github release
8+
9+
NOTE: these steps run also in the CI pipeline so you can find the NSIS Windows installer attached to any run of the CI.

NetlistViewer/distrib/setup.nsi

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
; NOTE: the version should be the same as the one in svn_revision.sh (see the UPP_VERSION #define)
3131
!define PRODUCT_NAME "NetlistViewer"
32-
!define PRODUCT_VERSION "0.3"
32+
!define PRODUCT_VERSION "0.4"
3333
!define PRODUCT_PUBLISHER "Francesco Montorsi"
3434
!define INSTALLER_MODE "release" ; choose between "debug" and "release"
3535

@@ -71,7 +71,7 @@
7171
VIAddVersionKey "Comments" ""
7272
VIAddVersionKey "CompanyName" "${PRODUCT_NAME} Team"
7373
VIAddVersionKey "LegalTrademarks" "Application released under the GNU GPL"
74-
VIAddVersionKey "LegalCopyright" "© ${PRODUCT_NAME} Team"
74+
VIAddVersionKey "LegalCopyright" " ${PRODUCT_NAME} Team"
7575
VIAddVersionKey "FileDescription" "Text to schematic conversion of SPICE netlists"
7676
VIAddVersionKey "FileVersion" "${PRODUCT_VERSION}"
7777
VIProductVersion "${PRODUCT_VERSION}.0.0"

NetlistViewer/src/app.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
// constants
3939
// ----------------------------------------------------------------------------
4040

41-
#define SW_VERSION_STR "0.3"
41+
#define SW_VERSION_STR "0.4"
42+
#define SW_COPYRIGHT_STR "(C) 2010-2025"
43+
#define HELP_PAGE "https://github.com/f18m/netlist-viewer/issues"
4244

4345
// IDs for the controls and the menu commands
4446
enum
@@ -406,8 +408,6 @@ void SpiceViewerFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
406408

407409
void SpiceViewerFrame::OnHelp(wxCommandEvent& WXUNUSED(event))
408410
{
409-
#define HELP_PAGE "https://sourceforge.net/p/netlistviewer/tickets/"
410-
411411
if (!wxLaunchDefaultBrowser(HELP_PAGE))
412412
wxLogError("Could not open the URL '%s'... please open it manually.", HELP_PAGE);
413413
}
@@ -418,7 +418,7 @@ void SpiceViewerFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
418418
aboutInfo.SetName("Netlist Viewer");
419419
aboutInfo.SetVersion(SW_VERSION_STR);
420420
aboutInfo.SetDescription("SPICE netlist viewer. This program converts a SPICE text netlist to a graphical schematic.");
421-
aboutInfo.SetCopyright("(C) 2010-2023");
421+
aboutInfo.SetCopyright(SW_COPYRIGHT_STR);
422422
aboutInfo.SetWebSite("https://github.com/f18m/netlist-viewer");
423423
aboutInfo.AddDeveloper("Francesco Montorsi <francesco.montorsi@gmail.com>");
424424

README.md

+25-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,37 @@
1-
# netlist-viewer
1+
# Netlist Viewer
22

33
Netlist Viewer is a tool capable of loading SPICE netlists and convert them in a schematic (i.e. graphical) format.
44
The graphical representations helps to understand the electrical/electronic circuit represented by the SPICE netlist, and save some tedious work.
55

6+
# What is a netlist?
7+
8+
A [circuit diagram](https://en.wikipedia.org/wiki/Circuit_diagram) can be represented in a very compact form using a [netlist](https://en.wikipedia.org/wiki/Netlist). Wikipedia's definition of the netlist is "a list of the electronic components in a circuit and a list of the nodes they are connected to".
9+
An example of how a netlist actually looks like is:
10+
11+
```
12+
.SUBCKT test_misc1 IN OUT
13+
14+
V1 0 IN DC=4V
15+
R1 IN 2
16+
Q1 3 2 0 NPNstd
17+
M1 OUT 3 0 NMOSstd
18+
D1 OUT 0 DIODEstd
19+
20+
.ENDS
21+
```
22+
623
# Screenshots
724

825
![1](https://github.com/f18m/netlist-viewer/assets/9748595/ff8c1017-f92b-4f33-b399-36a6affe25de)
926
![2](https://github.com/f18m/netlist-viewer/assets/9748595/9a7054e3-cc1b-469b-82e9-95874dc7773a)
1027

28+
# Binaries
29+
30+
You can download binaries from [Github releases](https://github.com/f18m/netlist-viewer/releases).
31+
These binaries are not garantueed to work on your system.
32+
A better way to distribute applications for Linux would be using [Flatpak](https://github.com/f18m/netlist-viewer/issues/6).
33+
If you are interested in such work, please open an issue/PR.
34+
1135
# Past versions of Netlist-viewer
1236

1337
Past versions, namely version 0.1 and version 0.2, were hosted in Sourceforge, see https://sourceforge.net/projects/netlistviewer/.

0 commit comments

Comments
 (0)