Skip to content

GH action - automatic release #11

GH action - automatic release

GH action - automatic release #11

Workflow file for this run

name: release
on:
push:
tags-ignore:
- 'test-*'
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x' # SDK Version to use.
- run: |
Invoke-WebRequest -OutFile Update-AssemblyInfoVersionFiles.ps1 https://gist.githubusercontent.com/lowleveldesign/663de4e0d5a071f938e6f7c82d7ca9a0/raw/Update-AssemblyInfoVersionFiles.ps1
./Update-AssemblyInfoVersionFiles.ps1
- run: dotnet test -c release
working-directory: ./procgov-tests
- run: dotnet publish -c release -r win-x86 --self-contained
working-directory: ./procgov
- run: dotnet publish -c release -r win-x64 --self-contained
working-directory: ./procgov
- name: Copy artifacts
run: |
New-Item -Type Directory -Path artifacts
Copy-Item -Path "procgov/bin/release/net8.0-windows/win-x86/publish/procgov.exe" -Destination "artifacts/procgov32.exe"
Copy-Item -Path "procgov/bin/release/net8.0-windows/win-x86/publish/procgov.pdb" -Destination "artifacts/procgov32.pdb"
Copy-Item -Path "procgov/bin/release/net8.0-windows/win-x64/publish/procgov.exe" -Destination "artifacts/procgov64.exe"
Copy-Item -Path "procgov/bin/release/net8.0-windows/win-x64/publish/procgov.pdb" -Destination "artifacts/procgov64.pdb"
- name: Zip binaries
run: |
Compress-Archive -Path "artifacts/*.exe", "artifacts/*.pdb" -DestinationPath "procgov.zip"
- uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.WINGET_GH_TOKEN }}"
prerelease: true
files: procgov.zip
- name: Copy the binary to Chocolatey path
run: |
Copy-Item artifacts\procgov32.exe choco\tools
Copy-Item artifacts\procgov32.pdb choco\tools
Copy-Item artifacts\procgov64.exe choco\tools
Copy-Item artifacts\procgov64.pdb choco\tools
- run: |
Invoke-WebRequest -OutFile Print-FileHashes.ps1 https://gist.githubusercontent.com/lowleveldesign/f1afd42662ee8dabe07cf8cbfe25e6a1/raw/Print-FileHashes.ps1
"## procgov32.exe" >> choco\tools\VERIFICATION.txt
./Print-FileHashes.ps1 -FilePath choco\tools\procgov32.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
- name: Build Chocolatey package
run: choco pack
working-directory: choco
- uses: actions/upload-artifact@v4
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