Skip to content

Commit

Permalink
Add GitHub build workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
sieukrem committed Oct 3, 2024
1 parent ec27d85 commit f8138cf
Show file tree
Hide file tree
Showing 14 changed files with 221 additions and 658 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build Visual Studio Project

on: [push]

jobs:
build:
runs-on: windows-latest
strategy:
matrix:
platform: [x86, x64]
configuration: [Debug, Release]

steps:
- name: Checkout code
uses: actions/checkout@v4.2.0
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.

- uses: dotnet/nbgv@master
id: nbgv

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2

- name: Build with MSBuild
run: |
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}}
- name: Create zip file
run: |
if ("${{ matrix.platform }}" -eq "x64"){
Copy-Item ${{ matrix.platform}}/${{ matrix.configuration }}/*.dll ./deploy/
} else {
Copy-Item ${{ matrix.configuration }}/*.dll ./deploy/
}
cd ./deploy
7z a ../jN_${{ steps.nbgv.outputs.SemVer2 }}_${{ matrix.platform }}.zip *
- name: Upload artifacts
uses: actions/upload-artifact@v4.4.0
with:
name: Build artifacts ${{ matrix.platform }} ${{ matrix.configuration }}
path: |
jN_*.zip
${{ matrix.configuration }}/*.dll
${{ matrix.configuration }}/*.pdb
${{ matrix.platform }}/${{ matrix.configuration }}/*.dll
${{ matrix.platform }}/${{ matrix.configuration }}/*.pdb
retention-days: 3
106 changes: 106 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Create Release

on:
workflow_dispatch:

jobs:
build:
runs-on: windows-latest
strategy:
matrix:
platform: [x86, x64]
configuration: [Release]

steps:
- name: Checkout code
uses: actions/checkout@v4.2.0
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.

- uses: dotnet/nbgv@master
id: nbgv

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2

- name: Build with MSBuild
run: |
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}}
- name: Create zip file
run: |
if ("${{ matrix.platform }}" -eq "x64"){
Copy-Item ${{ matrix.platform}}/${{ matrix.configuration }}/*.dll ./deploy/
} else {
Copy-Item ${{ matrix.configuration }}/*.dll ./deploy/
}
cd ./deploy
7z a ../jN_${{ steps.nbgv.outputs.SemVer2 }}_${{ matrix.platform }}.zip *
- name: Upload artifacts
uses: actions/upload-artifact@v4.4.0
with:
name: Build artifacts
path: |
jN_*.zip
${{ matrix.configuration }}/*.dll
${{ matrix.configuration }}/*.pdb
${{ matrix.platform }}/${{ matrix.configuration }}/*.dll
${{ matrix.platform }}/${{ matrix.configuration }}/*.pdb
retention-days: 3

release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4.2.0
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.

- uses: dotnet/nbgv@master
id: nbgv

- name: Create Tag
run: git tag ${{ steps.nbgv.outputs.SemVer2 }}

- name: Push Tag
run: git push origin ${{ steps.nbgv.outputs.SemVer2 }}

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.nbgv.outputs.SemVer2 }}
release_name: ${{ steps.nbgv.outputs.SemVer2 }}
draft: true
prerelease: false

- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: Build artifacts

- name: Upload x64
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: jN_${{ steps.nbgv.outputs.SemVer2 }}_x64.zip
asset_name: jN_${{ steps.nbgv.outputs.SemVer2 }}_x64.zip
asset_content_type: application/zip

- name: Upload x86
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: jN_${{ steps.nbgv.outputs.SemVer2 }}_x86.zip
asset_name: jN_${{ steps.nbgv.outputs.SemVer2 }}_x86.zip
asset_content_type: application/zip
29 changes: 23 additions & 6 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
# jN Npp Plugin
[![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)

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

## Technology
jN uses the built-in javascript engine of Microsoft Windows. This powerful engine allows to access a lot of ActiveX base

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

## Getting Started
You will find the features list and examples in [wiki](https://github.com/sieukrem/jn-npp-plugin/wiki).
`jN` wraps the native Notepad++ API into ActiveX interfaces accessible via global objects `Editor` and `System` in your JavaScript code.

## How to Use - Getting Started

You will find the feature list and examples in [wiki](https://github.com/sieukrem/jn-npp-plugin/wiki).

## For Developers

### Folder Structure

- `common` - implementation of Notepad++ independent ActiveX elements (e.g. Dialog, Menu, WinApi, System, ...).
- `editor` - implementation of Notepad++ related ActiveX elements (e.g. DockableDialog, View, ViewLine).
- `npp` - copy-in files from original Notepad++ plugin template project.
- `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.

### Building

Open `jN.sln` in Visual Studio and build solution.

> Rebuild entire solution every time you modified any of `*.idl` files!
24 changes: 18 additions & 6 deletions VersionInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,24 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef VERSION_MA
#define VERSION_MA 2
#define VERSION_MI 2
#endif

// increment revision in case of modification
#define REVISION 185
#define xstr(s) str(s)
#define str(s) #s
#define _VERSION_STR VERSION_MA ## . ## REVISION
#ifndef VERSION_MI
#define VERSION_MI 2
#endif

#ifndef BUILD_NUMBER
// increment BUILD_NUMBER in case of modification
#define BUILD_NUMBER 185
#endif

#ifndef VERSION_REVISION
#define VERSION_REVISION 0
#endif

#define xstr(s) str(s)
#define str(s) #s
#define _VERSION_STR VERSION_MA ## . ## VERSION_MI ## . ## BUILD_NUMBER ## . ## VERSION_REVISION

27 changes: 0 additions & 27 deletions VersionInfo_tmpl.h

This file was deleted.

File renamed without changes.
15 changes: 0 additions & 15 deletions build.xml

This file was deleted.

26 changes: 0 additions & 26 deletions jN.2015.sln

This file was deleted.

File renamed without changes.
Loading

0 comments on commit f8138cf

Please sign in to comment.