Skip to content

Commit ac94bae

Browse files
[+] Include build workflow
1 parent 254394e commit ac94bae

5 files changed

Lines changed: 89 additions & 3 deletions

File tree

.github/workflows/main.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Test PowerShell on Ubuntu
2+
3+
# Controls when the workflow will run
4+
# https://docs.github.com/en/actions/using-workflows/triggering-a-workflow
5+
on:
6+
push:
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
lint-with-PSScriptAnalyzer:
12+
name: Install and run PSScriptAnalyzer
13+
runs-on: ubuntu-latest
14+
steps:
15+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
16+
- name: Check out repository code
17+
uses: actions/checkout@v3
18+
19+
- name: Install PSScriptAnalyzer module
20+
shell: pwsh
21+
run: |
22+
Set-PSRepository PSGallery -InstallationPolicy Trusted
23+
Install-Module PSScriptAnalyzer -ErrorAction Stop
24+
25+
- name: Lint with PSScriptAnalyzer
26+
shell: pwsh
27+
run: |
28+
Invoke-ScriptAnalyzer -Path *.ps1 -Recurse -Outvariable issues
29+
$errors = $issues.Where({$_.Severity -eq 'Error'})
30+
$warnings = $issues.Where({$_.Severity -eq 'Warning'})
31+
if ($errors) {
32+
Write-Error "There were $($errors.Count) errors and $($warnings.Count) warnings total." -ErrorAction Stop
33+
} else {
34+
Write-Output "There were $($errors.Count) errors and $($warnings.Count) warnings total."
35+
}
36+
37+
pester-test:
38+
name: Test module and upload results
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: Check out repository code
42+
uses: actions/checkout@v3
43+
44+
- name: Test with Pester
45+
shell: pwsh
46+
run: Invoke-Pester -Passthru | Export-Clixml -Path Module.Tests.xml
47+
48+
- name: Upload test results
49+
uses: actions/upload-artifact@v3
50+
with:
51+
name: ubuntu-Module-Tests
52+
path: ./Module.Tests.xml
53+
# The always() function configures the job to continue processing even if there are test failures. For more information, see "always."
54+
if: ${{ always() }}
55+
56+
publish-to-gallery:
57+
name: Publish module
58+
runs-on: ubuntu-latest
59+
steps:
60+
- name: Check out repository code
61+
uses: actions/checkout@v3
62+
63+
- name: Publish
64+
env:
65+
NUGET_KEY: ${{ secrets.NUGET_KEY }}
66+
shell: pwsh
67+
run: |
68+
New-Item -Path "./Output/PSGithub" -ItemType Directory
69+
Copy-Item -Path "./PSGithub/*" -Destination "./Output/PSGithub" -Recurse
70+
Publish-Module -Path "./Output/PSGithub" -NuGetApiKey $env:NUGET_KEY -Verbose
71+
# Only publish on release
72+
if: ${{ github.event_name == 'release' }}
73+
needs: [lint-with-PSScriptAnalyzer, pester-test]

LICENSE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) 2023 RootITUp UG (haftungsbeschränkt)
4+
5+
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:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
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.

PSGithub/PSGithub.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
# ProcessorArchitecture = ''
5252

5353
# Modules that must be imported into the global environment prior to importing this module
54-
RequiredModules = @("PowerShellForGitHub")
54+
# RequiredModules = @()
5555

5656
# Assemblies that must be loaded prior to importing this module
5757
# RequiredAssemblies = @()

PSGithub/PSGithub.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ foreach ($file in $Private:files) {
1818

1919
$securityLibPath = ""
2020
if ($PSVersionTable.PSVersion.Major -lt 7){
21-
$securityDll = Get-ChildItem -Path ".\lib\BouncyCastle.Cryptography.2.2.1\lib\net461\BouncyCastle.Cryptography.dll"
21+
$securityDll = Get-ChildItem -Path "$PSScriptRoot\lib\BouncyCastle.Cryptography.2.2.1\lib\net461\BouncyCastle.Cryptography.dll"
2222
$securityLibPath = $securityDll.FullName
2323
}else{
2424
throw [System.NotImplementedException]::new($PSVersionTable.PSVersion)

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@ New-OrganizationMember -Token $token -Organization "adesso-Copilot" -Email "torb
1717
Set-GitHubConfiguration -DisableTelemetry
1818
Get-GitHubOrganizationMember -AccessToken $token -OrganizationName "adesso-Copilot"
1919
Test-GitHubOrganizationMember -AccessToken $token -OrganizationName "adesso-Copilot" -UserName "MarkusSchoelzel"
20-
```
20+
```
21+
22+
## Authors
23+
24+
- **Torben Soennecken**

0 commit comments

Comments
 (0)