Skip to content

Commit faa5081

Browse files
committed
Add GitHub build workflows
1 parent ec27d85 commit faa5081

14 files changed

+221
-658
lines changed

.github/workflows/build.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Build Visual Studio Project
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: windows-latest
8+
strategy:
9+
matrix:
10+
platform: [x86, x64]
11+
configuration: [Debug, Release]
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/[email protected]
16+
with:
17+
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
18+
19+
- uses: dotnet/nbgv@master
20+
id: nbgv
21+
22+
- name: Setup MSBuild
23+
uses: microsoft/setup-msbuild@v2
24+
25+
- name: Build with MSBuild
26+
run: |
27+
msbuild jN.vcxproj /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} /p:VersionMajor=${{steps.nbgv.outputs.VersionMajor}} /p:VersionMinor=${{steps.nbgv.outputs.VersionMinor}} /p:BuildNumber=${{steps.nbgv.outputs.BuildNumber}} /p:VersionRevision=${{steps.nbgv.outputs.VersionRevision}}
28+
29+
- name: Create zip file
30+
run: |
31+
if ("${{ matrix.platform }}" -eq "x64"){
32+
Copy-Item ${{ matrix.platform}}/${{ matrix.configuration }}/*.dll ./deploy/
33+
} else {
34+
Copy-Item ${{ matrix.configuration }}/*.dll ./deploy/
35+
}
36+
37+
cd ./deploy
38+
7z a ../jN_${{ steps.nbgv.outputs.SemVer2 }}_${{ matrix.platform }}.zip *
39+
40+
- name: Upload artifacts
41+
uses: actions/[email protected]
42+
with:
43+
name: Build artifacts ${{ matrix.platform }} ${{ matrix.configuration }}
44+
path: |
45+
jN_*.zip
46+
${{ matrix.configuration }}/*.dll
47+
${{ matrix.configuration }}/*.pdb
48+
${{ matrix.platform }}/${{ matrix.configuration }}/*.dll
49+
${{ matrix.platform }}/${{ matrix.configuration }}/*.pdb
50+
51+
retention-days: 3

.github/workflows/create-release.yml

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Create Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
runs-on: windows-latest
9+
strategy:
10+
matrix:
11+
platform: [x86, x64]
12+
configuration: [Release]
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/[email protected]
17+
with:
18+
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
19+
20+
- uses: dotnet/nbgv@master
21+
id: nbgv
22+
23+
- name: Setup MSBuild
24+
uses: microsoft/setup-msbuild@v2
25+
26+
- name: Build with MSBuild
27+
run: |
28+
msbuild jN.vcxproj /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} /p:VersionMajor=${{steps.nbgv.outputs.VersionMajor}} /p:VersionMinor=${{steps.nbgv.outputs.VersionMinor}} /p:BuildNumber=${{steps.nbgv.outputs.BuildNumber}} /p:VersionRevision=${{steps.nbgv.outputs.VersionRevision}}
29+
30+
- name: Create zip file
31+
run: |
32+
if ("${{ matrix.platform }}" -eq "x64"){
33+
Copy-Item ${{ matrix.platform}}/${{ matrix.configuration }}/*.dll ./deploy/
34+
} else {
35+
Copy-Item ${{ matrix.configuration }}/*.dll ./deploy/
36+
}
37+
38+
cd ./deploy
39+
7z a ../jN_${{ steps.nbgv.outputs.SemVer2 }}_${{ matrix.platform }}.zip *
40+
41+
- name: Upload artifacts
42+
uses: actions/[email protected]
43+
with:
44+
name: Build artifacts
45+
path: |
46+
jN_*.zip
47+
${{ matrix.configuration }}/*.dll
48+
${{ matrix.configuration }}/*.pdb
49+
${{ matrix.platform }}/${{ matrix.configuration }}/*.dll
50+
${{ matrix.platform }}/${{ matrix.configuration }}/*.pdb
51+
52+
retention-days: 3
53+
54+
release:
55+
needs: build
56+
runs-on: ubuntu-latest
57+
steps:
58+
- name: Checkout code
59+
uses: actions/[email protected]
60+
with:
61+
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
62+
63+
- uses: dotnet/nbgv@master
64+
id: nbgv
65+
66+
- name: Create Tag
67+
run: git tag ${{ steps.nbgv.outputs.SemVer2 }}
68+
69+
- name: Push Tag
70+
run: git push origin ${{ steps.nbgv.outputs.SemVer2 }}
71+
72+
- name: Create Release
73+
id: create_release
74+
uses: actions/create-release@v1
75+
env:
76+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77+
with:
78+
tag_name: ${{ steps.nbgv.outputs.SemVer2 }}
79+
release_name: ${{ steps.nbgv.outputs.SemVer2 }}
80+
draft: true
81+
prerelease: false
82+
83+
- name: Download artifacts
84+
uses: actions/download-artifact@v2
85+
with:
86+
name: Build artifacts
87+
88+
- name: Upload x64
89+
uses: actions/[email protected]
90+
env:
91+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92+
with:
93+
upload_url: ${{ steps.create_release.outputs.upload_url }}
94+
asset_path: jN_${{ steps.nbgv.outputs.SemVer2 }}_x64.zip
95+
asset_name: jN_${{ steps.nbgv.outputs.SemVer2 }}_x64.zip
96+
asset_content_type: application/zip
97+
98+
- name: Upload x86
99+
uses: actions/[email protected]
100+
env:
101+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
102+
with:
103+
upload_url: ${{ steps.create_release.outputs.upload_url }}
104+
asset_path: jN_${{ steps.nbgv.outputs.SemVer2 }}_x86.zip
105+
asset_name: jN_${{ steps.nbgv.outputs.SemVer2 }}_x86.zip
106+
asset_content_type: application/zip

Readme.md

+23-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,29 @@
11
# jN Npp Plugin
2-
[![Build status](https://ci.appveyor.com/api/projects/status/80mwe62vnmtkjy7o/branch/master?svg=true)](https://ci.appveyor.com/project/sieukrem/jn-npp-plugin/branch/master)
32

4-
jN (JavaScript for Notepad++) allows you to extend Notepad++ by using JavaScript.
3+
`jN Npp Plugin` is a plugin for Notepad++, which allows you to extend Notepad++ by writing JavaScript code.
54

65
## Technology
7-
jN uses the built-in javascript engine of Microsoft Windows. This powerful engine allows to access a lot of ActiveX base
6+
7+
`jN` uses the built-in javascript engine of Microsoft Windows. This powerful engine allows to access a lot of ActiveX based
88
services like Shell, WMI of operating system.
9-
Due to automate Notepad++ jN wraps the Notepad++ API into ActiveX interfaces accessible via global objects *Editor* and *System*.
109

11-
## Getting Started
12-
You will find the features list and examples in [wiki](https://github.com/sieukrem/jn-npp-plugin/wiki).
10+
`jN` wraps the native Notepad++ API into ActiveX interfaces accessible via global objects `Editor` and `System` in your JavaScript code.
11+
12+
## How to Use - Getting Started
13+
14+
You will find the feature list and examples in [wiki](https://github.com/sieukrem/jn-npp-plugin/wiki).
15+
16+
## For Developers
17+
18+
### Folder Structure
19+
20+
- `common` - implementation of Notepad++ independent ActiveX elements (e.g. Dialog, Menu, WinApi, System, ...).
21+
- `editor` - implementation of Notepad++ related ActiveX elements (e.g. DockableDialog, View, ViewLine).
22+
- `npp` - copy-in files from original Notepad++ plugin template project.
23+
- `deploy` - collection of JavaScript files, which were meant to show capabilities of `jN`, but contain also some useful functions like XML, Grep, Zen Coding, SmartHighlighter.
24+
25+
### Building
26+
27+
Open `jN.sln` in Visual Studio and build solution.
28+
29+
> Rebuild entire solution every time you modified any of `*.idl` files!

VersionInfo.h

+18-6
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,24 @@ You should have received a copy of the GNU General Public License
1616
along with this program. If not, see <http://www.gnu.org/licenses/>.
1717
*/
1818

19+
#ifndef VERSION_MA
1920
#define VERSION_MA 2
20-
#define VERSION_MI 2
21+
#endif
2122

22-
// increment revision in case of modification
23-
#define REVISION 185
24-
#define xstr(s) str(s)
25-
#define str(s) #s
26-
#define _VERSION_STR VERSION_MA ## . ## REVISION
23+
#ifndef VERSION_MI
24+
#define VERSION_MI 2
25+
#endif
26+
27+
#ifndef BUILD_NUMBER
28+
// increment BUILD_NUMBER in case of modification
29+
#define BUILD_NUMBER 185
30+
#endif
31+
32+
#ifndef VERSION_REVISION
33+
#define VERSION_REVISION 0
34+
#endif
35+
36+
#define xstr(s) str(s)
37+
#define str(s) #s
38+
#define _VERSION_STR VERSION_MA ## . ## VERSION_MI ## . ## BUILD_NUMBER ## . ## VERSION_REVISION
2739

VersionInfo_tmpl.h

-27
This file was deleted.
File renamed without changes.

build.xml

-15
This file was deleted.

jN.2015.sln

-26
This file was deleted.

jN.9.sln renamed to jN.sln

File renamed without changes.

0 commit comments

Comments
 (0)