Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: gh-release #92

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.

# https://github.com/microsoft/github-actions-for-desktop-apps

# This continuous integration pipeline is triggered anytime a user tags the repo

# This pipeline builds the project, runs unit tests, then saves the build artifact.

name: Key-n-Stroke Release

# Trigger on every master branch push and pull request
on:
push:
tags:
- "*.*.*"

jobs:

build:
runs-on: windows-latest

env:
Solution_Path: KeyNStroke.sln
#Test_Project_Path: KeyNStroke.Tests\KeyNStroke.Tests.csproj
App_Project_Path: KeyNStroke\KeyNStroke.csproj
App_Output_Directory: KeyNStroke\bin
App_Assembly: Key-n-Stroke.exe
Actions_Allow_Unsecure_Commands: true # Allows AddPAth and SetEnv commands

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

# Versioning
- name: Use Nerdbank.GitVersioning to set version variables
uses: dotnet/nbgv@master
with:
setAllVars: true

# Add MsBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
uses: microsoft/[email protected]

#- name: Execute Unit Tests
# run: dotnet test $env:Test_Project_Path

# Restore the application
- name: Restore the application to populate the obj and packages folder
run: msbuild $env:Solution_Path /t:Restore /p:RestorePackagesConfig=true /p:Configuration=$env:Configuration
env:
Configuration: Release


# Actual build
- name: Build the application
run: msbuild $env:Solution_Path /t:Rebuild /p:Configuration=$env:Configuration /p:Platform="Any CPU"

env:
Configuration: Release


# TODO: Signing
# https://github.com/dlemstra/code-sign-action
# https://github.com/GabrielAcostaEngler/signtool-code-sign
# https://archi-lab.net/code-signing-assemblies-with-github-actions/

- name: Create release archive
uses: thedoctor0/zip-release@main
with:
type: 'zip'
filename: 'KeyNStroke-${{env.NBGV_SemVer2}}.zip'
directory: ${{ env.App_Output_Directory }}\Release\
exclusions: '*.git* *.pdb *.xml'


- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
LICENSE
README.md
${{ env.App_Output_Directory }}\Release\KeyNStroke-${{env.NBGV_SemVer2}}.zip