-
-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
54 changed files
with
1,517 additions
and
723 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
*.md eol=lf | ||
* -text |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/.github/ @gerardog | ||
/build/ @gerardog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
name: CI Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
tags-ignore: | ||
- '**' | ||
workflow_call: | ||
outputs: | ||
version: | ||
description: "Version" | ||
value: ${{ jobs.build.outputs.version }} | ||
version_MajorMinorPatch: | ||
description: "Version (without prerelease tag)" | ||
value: ${{ jobs.build.outputs.version_MajorMinorPatch }} | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: windows-latest | ||
permissions: | ||
id-token: write | ||
contents: read | ||
checks: write | ||
steps: | ||
- uses: actions/setup-dotnet@v2 | ||
with: | ||
dotnet-version: '7.0.x' | ||
include-prerelease: true | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Run Tests | ||
run: ./build/02-test.ps1 | ||
- name: Test Report DotNet | ||
uses: dorny/test-reporter@v1 | ||
if: success() || failure() # run this step even if previous step failed | ||
with: | ||
name: TestsResults (dotnet) | ||
path: "**/TestResults*.trx" | ||
reporter: dotnet-trx | ||
fail-on-error: false | ||
- name: Test Report PowerShell v5 | ||
uses: zyborg/pester-tests-report@v1.5.0 # https://github.com/zyborg/pester-tests-report#inputs | ||
if: success() || failure() # run this step even if previous step failed | ||
with: | ||
test_results_path: ./testResults_PS5.xml | ||
report_name: TestResults PowerShell v5.x | ||
report_title: PowerShell v5 Tests | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Test Report PowerShell v7 | ||
uses: zyborg/pester-tests-report@v1.5.0 # https://github.com/zyborg/pester-tests-report#inputs | ||
if: success() || failure() # run this step even if previous step failed | ||
with: | ||
test_results_path: ./testResults_PS7.xml | ||
report_name: TestResults PowerShell Core (v7.x) | ||
report_title: PowerShell v7 Tests | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
# - uses: OrbitalOwen/desktop-screenshot-action@0.1 | ||
# if: always() | ||
# with: | ||
# file-name: 'desktop.jpg' | ||
|
||
build: | ||
name: Build | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/setup-dotnet@v2 | ||
with: | ||
dotnet-version: '7.0.x' | ||
include-prerelease: true | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install dependencies | ||
run: choco install GitVersion.Portable ilmerge --confirm --no-progress | ||
- name: Update project version | ||
run: gitversion /l console /output buildserver /updateAssemblyInfo /verbosity minimal | ||
- name: Get project version | ||
id: getversion | ||
run: | | ||
echo "::set-output name=version::$(gitversion /showvariable LegacySemVer)" | ||
echo "::set-output name=version_MajorMinorPatch::$(gitversion /showvariable MajorMinorPatch)" | ||
- name: Build | ||
run: ./build/01-build.ps1 | ||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Binaries | ||
path: ./artifacts | ||
outputs: | ||
version: ${{ steps.getversion.outputs.version }} | ||
version_MajorMinorPatch: ${{ steps.getversion.outputs.version_MajorMinorPatch }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Docs Build & Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- docs | ||
paths: | ||
- 'docs/**' | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow one concurrent deployment | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
cache: yarn | ||
cache-dependency-path: '**/yarn.lock' | ||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
- name: Build website | ||
run: yarn build | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v2 | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
# Upload entire repository | ||
path: './docs/build' | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/ci.yml | ||
permissions: | ||
id-token: write | ||
contents: read | ||
checks: write | ||
|
||
release: | ||
name: Sign & Release to GitHub | ||
#if: github.ref == 'refs/heads/master' && github.repository == 'gerardog/gsudo' | ||
if: github.repository == 'gerardog/gsudo' | ||
runs-on: windows-latest | ||
environment: | ||
name: release-github | ||
needs: build | ||
env: | ||
cert_path: "C:\\secret\\cert.pfx" | ||
cert_key: ${{ secrets.P_F_X_Key }} | ||
version: ${{ needs.build.outputs.version }} | ||
version_MajorMinorPatch: ${{ needs.build.outputs.version_MajorMinorPatch }} | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: Binaries | ||
path: ./artifacts | ||
- name: Decode certificate | ||
# First encode and upload as environment secret using: [convert]::ToBase64String((Get-Content .\code_signing.pfx -AsByteStream)) | ||
run: | | ||
$pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.p_f_x }}") | ||
$_ = mkdir (split-path -parent $env:cert_path) -ErrorAction Ignore | ||
[IO.File]::WriteAllBytes("$env:cert_path", $pfx_cert_byte) | ||
- name: Code Sign | ||
run: ./build/03-sign.ps1 | ||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Binaries | ||
path: ./artifacts | ||
- name: Package for GitHub Release | ||
run: ./build/04-release-GitHub.ps1 | ||
- name: Remove the pfx | ||
run: Remove-Item -path $env:cert_path | ||
- name: Upload installer artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Installer | ||
path: ./artifacts/gsudoSetup.msi | ||
- name: Create Release | ||
uses: ncipollo/release-action@v1.10.0 | ||
with: | ||
artifacts: "artifacts/*.*" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
draft: true | ||
prerelease: true | ||
generateReleaseNotes: true | ||
name: gsudo v${{env.version}} | ||
tag: v${{env.version}} | ||
commit: ${{env.GITHUB_SHA}} | ||
allowUpdates: true | ||
omitBodyDuringUpdate: true | ||
replacesArtifacts: true | ||
|
||
chocolatey: | ||
name: Pack & Release to Chocolatey | ||
#if: github.ref == 'refs/heads/master' && github.repository == 'gerardog/gsudo' | ||
if: github.repository == 'gerardog/gsudo' | ||
runs-on: windows-latest | ||
needs: [build, release] | ||
environment: | ||
name: release-chocolatey | ||
env: | ||
version: ${{ needs.build.outputs.version }} | ||
version_MajorMinorPatch: ${{ needs.build.outputs.version_MajorMinorPatch }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: Binaries | ||
path: ./artifacts | ||
- name: Import Chocolatey Api Key | ||
run: choco apikey --key ${{ secrets.CHOCOLATEY_APIKEY }} --source https://push.chocolatey.org/ | ||
- name: Build Package for Chocolatey & Upload | ||
run: ./build/05-release-Chocolatey.ps1 | ||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Binaries | ||
path: ./artifacts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.