Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bhillkeyfactor committed Sep 1, 2021
0 parents commit 674cd1d
Show file tree
Hide file tree
Showing 134 changed files with 5,612 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/keyfactor-extension-generate-readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Update README
on: [push, workflow_dispatch]

jobs:
update_readme:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master

- uses: cuchi/jinja2-action@v1.2.0
with:
template: README.md.tpl
output_file: README.md
data_file: integration-manifest.json
env:
GITHUB_TOKEN: ${{ secrets.SDK_SYNC_PAT }}

- uses: stefanzweifel/git-auto-commit-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
push_options: '--force'
commit_message: Update generated README
commit_user_name: Keyfactor
commit_user_email: keyfactor@keyfactor.github.io
commit_author: Keyfactor <keyfactor@keyfactor.github.io>
124 changes: 124 additions & 0 deletions .github/workflows/keyfactor-extension-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# This is a basic workflow to help you get started with Actions

name: Keyfactor Extension - Release

env:
project_folder: \HydrantIdProxy\src\HydrantIdProxy

# Controls when the action will run.
on:
# Triggers the workflow on pull requests closing
pull_request:
# only run this workflow when closing a PR to a branch that contains a release number. ignore -pre
branches:
- 'release-[0-9]+.[0-9]+'
- '!release-[0-9]+.[0-9]+-pre'
types: [closed]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# run if pull request is completed and merged, or if manually dispatched
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true)

# The type of runner that the job will run on
runs-on: windows-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Setup Envrionment
id: setup_env
run: |
echo "Setup Envrionment Variables for Workflow"
echo "Working Path: ${Env:GITHUB_WORKSPACE}"
$slnPath = (Get-ChildItem -Include *.sln -File -Recurse).fullname
$relName = "${{ github.ref }}".Split("/")
$repoName = "${{ github.repository }}".Split("/")
echo "Solution File Path: ${slnPath}"
echo "SOLUTION_PATH=${slnPath}" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append
echo "Release Name: $($relName[-1])"
echo "RELEASE_NAME=$($relName[-1])" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append
echo "Repo Name: $($repoName[-1])"
echo "REPO_NAME=$($repoName[-1])" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x' # SDK Version to use; x will use the latest version of the 3.1 channel
#dotnet-version:

- name: Add Package Source
run: |
dotnet nuget add source https://nuget.pkg.github.com/Keyfactor/index.json -n github -u ${{ github.actor }} -p ${{ secrets.BUILD_PACKAGE_ACCESS }} --store-password-in-clear-text
# Configures msbuild path envrionment
- name: setup-msbuild
uses: microsoft/setup-msbuild@v1

# Restores Packages to Local Machine
- name: restore nuget packages
run: |
nuget restore ${{ env.SOLUTION_PATH }}
- name: Create Release
id: create_release
#uses: zendesk/action-create-release@v1
uses: keyfactor/action-create-release@786b73035fa09790f9eb11bb86834a6d7af1c256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_name: Release ${{ env.RELEASE_NAME }}
body: |
[Changelog](../CHANGELOG.MD)
draft: false
prerelease: false
auto_increment_type: patch
tag_schema: semantic
commitish: ${{ github.sha }}

#update version number of AssemblyInfo.cs file
- name: Increment Assembly Version
run: |
$VersionRegex = "\d+\.\d+\.\d+"
$assemlyFilePath = (Get-ChildItem -Include AssemblyInfo.cs -File -Recurse).fullname
$filecontent = Get-Content($assemlyFilePath)
$newVer = "${{ steps.create_release.outputs.current_tag }}".TrimStart('v')
attrib $assemlyFilePath -r
$filecontent -replace $VersionRegex, $newVer | Out-File $assemlyFilePath
- name: Execute MSBuild Commands
run: |
MSBuild.exe $Env:SOLUTION_PATH -p:RestorePackagesConfig=false -p:Configuration=Release
- name: Archive Files
if: ${{ success() }}
run: |
md ${{ github.workspace }}\zip\Keyfactor
Compress-Archive -Path ${{ github.workspace }}\${{env.project_folder}}\bin\Release\*.dll,${{ github.workspace }}\${{env.project_folder}}\bin\Release\*.json -DestinationPath ${{ github.workspace }}\zip\Keyfactor\$Env:REPO_NAME.zip -Force
- name: Upload Release Asset (x64)
if: ${{ success() }}
id: upload-release-asset-x64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}\zip\Keyfactor\${{ env.REPO_NAME}}.zip
asset_name: ${{ env.REPO_NAME}}_${{ steps.create_release.outputs.current_tag }}.zip
asset_content_type: application/zip

- name: On Failure - Remove Tags and Release
if: ${{ failure() }}
uses: dev-drprasad/delete-tag-and-release@v0.2.0
with:
delete_release: true # default: false
tag_name: ${{ steps.create_release.outputs.current_tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 674cd1d

Please sign in to comment.