Skip to content

Commit

Permalink
Preparing procgov for choco
Browse files Browse the repository at this point in the history
  • Loading branch information
lowleveldesign committed Jul 26, 2021
1 parent 6a01a46 commit 0101bc7
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- uses: actions/upload-artifact@v2
with:
name: wtrace
name: procgov
path: |
ProcessGovernor\bin\x86\Release\procgov.exe
ProcessGovernor\bin\x86\Release\procgov.pdb
Expand Down
79 changes: 79 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: release

on:
push:
tags:
- '*'

jobs:
build:

runs-on: windows-latest

steps:
- uses: actions/checkout@v2

- name: Setup nuget
uses: nuget/setup-nuget@v1

- run: |
Invoke-WebRequest -OutFile Update-AssemblyInfoVersionFiles.ps1 https://gist.githubusercontent.com/lowleveldesign/663de4e0d5a071f938e6f7c82d7ca9a0/raw/Update-AssemblyInfoVersionFiles.ps1
./Update-AssemblyInfoVersionFiles.ps1
shell: pwsh
- name: Restore packages
run: nuget restore ProcessGovernor.sln

- name: Setup MSBuild.exe
uses: microsoft/[email protected]

- name: Build Release using MSBuild
run: msbuild ProcessGovernor.sln -m /p:Configuration=Release /p:Platform=x86

- name: Build Release using MSBuild
run: msbuild ProcessGovernor.sln -m /p:Configuration=Release /p:Platform=x64

- name: Rename 64-bit artifacts
run: |
Rename-Item -Path "ProcessGovernor\bin\x64\Release\procgov.exe" -NewName "procgov64.exe"
Rename-Item -Path "ProcessGovernor\bin\x64\Release\procgov.pdb" -NewName "procgov64.pdb"
- uses: actions/upload-artifact@v2
with:
name: procgov
path: |
ProcessGovernor\bin\x86\Release\procgov.exe
ProcessGovernor\bin\x86\Release\procgov.pdb
ProcessGovernor\bin\x64\Release\procgov64.exe
ProcessGovernor\bin\x64\Release\procgov64.pdb
- name: Copy the binary to Chocolatey path
run: |
Copy-Item ProcessGovernor\bin\x86\Release\procgov.exe choco\tools
Copy-Item ProcessGovernor\bin\x86\Release\procgov.pdb choco\tools
Copy-Item ProcessGovernor\bin\x64\Release\procgov64.exe choco\tools
Copy-Item ProcessGovernor\bin\x64\Release\procgov64.pdb choco\tools
- run: |
Invoke-WebRequest -OutFile Print-FileHashes.ps1 https://gist.githubusercontent.com/lowleveldesign/f1afd42662ee8dabe07cf8cbfe25e6a1/raw/Print-FileHashes.ps1
"## procgov.exe" >> choco\tools\VERIFICATION.txt
./Print-FileHashes.ps1 -FilePath choco\tools\procgov.exe >> choco\tools\VERIFICATION.txt
"" >> choco\tools\VERIFICATION.txt
"## procgov64.exe" >> choco\tools\VERIFICATION.txt
./Print-FileHashes.ps1 -FilePath choco\tools\procgov64.exe >> choco\tools\VERIFICATION.txt
shell: pwsh
- name: Build Chocolatey package
run: choco pack
working-directory: choco

- uses: actions/upload-artifact@v2
with:
name: procgov-pkg
path: choco\procgov.*.nupkg

- name: Release Chocolatey package
run: choco push $(Resolve-Path "procgov.*.nupkg") -s https://push.chocolatey.org/ -k "$env:CHOCO_KEY"
env:
CHOCO_KEY: ${{ secrets.CHOCO_KEY }}
working-directory: choco
31 changes: 31 additions & 0 deletions choco/procgov.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Read this before creating packages: https://chocolatey.org/docs/create-packages -->
<!-- It is especially important to read the above link to understand additional requirements when publishing packages to the community feed aka dot org (https://chocolatey.org/packages). -->

<!-- Do not remove this test for UTF-8: if “Ω” doesn’t appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>procgov</id>
<version>1.0.0.0</version>
<!-- == SOFTWARE SPECIFIC SECTION == -->
<title>procgov</title>
<authors>Sebastian Solnica</authors>
<projectUrl>https://github.com/lowleveldesign/process-governor</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<projectSourceUrl>https://github.com/lowleveldesign/process-governor</projectSourceUrl>
<docsUrl>https://github.com/lowleveldesign/process-governor#readme</docsUrl>
<bugTrackerUrl>https://github.com/lowleveldesign/process-governor/issues</bugTrackerUrl>
<tags>windows process limit</tags>
<summary>This application allows you to put various limits on a Windows process.</summary>
<description>This application allows you to set constraints on a process, including CPU affinity, rate, committed memory, used physical memory (Working Set) and more. It uses a job object for this purpose.

You may set limits on a newly created process or on an already running one.

Starting from version 2.8, it is possible to update once set the limits. Simply run procgov providing new limits and the target process ID.

REMEMBER to always use procgov with the same bitness as your application.</description>
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>
22 changes: 22 additions & 0 deletions choco/tools/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

MIT License

Copyright (c) 2021 Sebastian Solnica

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 4 additions & 0 deletions choco/tools/VERIFICATION.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
VERIFICATION

The hashes below were computed for the executable files contained in this package. You may calculate the hashes for the official release (available at https://github.com/lowleveldesign/process-governor/releases) and compare them with these values to verify the installed binaries.

0 comments on commit 0101bc7

Please sign in to comment.