Skip to content

Commit 023f93e

Browse files
committed
Merge remote-tracking branch 'origin/main' into screenshots
# Conflicts: # .github/workflows/starter.yml
2 parents f730fdb + 95c1fc0 commit 023f93e

11 files changed

Lines changed: 263 additions & 30 deletions

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# See GitHub's documentation for more information on this file:
2+
# https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates
3+
version: 2
4+
updates:
5+
- package-ecosystem: "github-actions"
6+
directory: "/"
7+
schedule:
8+
interval: "daily"

.github/workflows/assign-env-from-json.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ on:
1414
update_catalog:
1515
description: The release_dir property from integration-manifest.json
1616
value: ${{ jobs.assign-from-json.outputs.update_catalog }}
17+
release_project:
18+
description: The release_project property from integration-manifest.json
19+
value: ${{ jobs.assign-from-json.outputs.release_project }}
1720
UOFramework:
1821
description: The UOFramework property from integration-manifest.json
1922
value: ${{ jobs.assign-from-json.outputs.UOFramework }}
@@ -28,6 +31,7 @@ jobs:
2831
update_catalog: ${{ steps.read-update_catalog.outputs.output-value }}
2932
UOFramework: ${{ steps.read-UOFramework.outputs.output-value }}
3033
description: ${{ steps.read-description.outputs.output-value }}
34+
release_project: ${{ steps.read-release_project.outputs.output-value }}
3135
name: Set workflow variables from integration-manifest.json
3236
steps:
3337
- name: checkout-json-file
@@ -60,6 +64,14 @@ jobs:
6064
input-file: 'src/integration-manifest.json'
6165
input-property: 'integration_type'
6266

67+
- name: Read release_project property
68+
uses: ./tools
69+
id: read-release_project
70+
with:
71+
input-file: 'src/integration-manifest.json'
72+
input-property: 'release_project'
73+
required-value: 'false'
74+
6375
- name: Read update_catalog property
6476
uses: ./tools
6577
id: read-update_catalog
@@ -93,7 +105,6 @@ jobs:
93105
input-property: 'about.orchestrator.keyfactor_platform_version'
94106

95107
- name: Read release_dir property
96-
if: steps.read-type.outputs.output-value == 'orchestrator' || steps.read-type.outputs.output-value == 'ca-gateway' || steps.read-type.outputs.output-value == 'pam' || steps.read-type.outputs.output-value == 'anyca-plugin'
97108
uses: ./tools
98109
id: read-release_dir
99110
with:
@@ -122,5 +133,6 @@ jobs:
122133
fi
123134
fi
124135
echo "* ${{ steps.read-release_dir.outputs.output-property }} : ${{ steps.read-release_dir.outputs.output-value }}" >> $GITHUB_STEP_SUMMARY
136+
echo "* ${{ steps.read-release_project.outputs.output-property }} : ${{ steps.read-release_project.outputs.output-value }}" >> $GITHUB_STEP_SUMMARY
125137
126138
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Check for TODOs and License headers
2+
3+
on: workflow_call
4+
5+
jobs:
6+
grep_todo_job:
7+
name: Grep TODO and License Headers
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v4
13+
14+
- name: Check for TODO statements
15+
run: (find . -iname "*.cs" "*.go" -exec grep -qi "todo" {} \; -print) | tee ./todo_log.txt
16+
17+
- name: Save todo log
18+
if: success()
19+
uses: actions/upload-artifact@v4
20+
with:
21+
name: todologs
22+
path: ./**/todo_log.txt
23+
24+
- name: Check for Apache License headers
25+
run: (find . \( -path "./git*" -o -name "README.md" -o -name "AssemblyInfo.cs" \) -prune -o -type f -iname "*.cs" -iname "*.go"-exec grep -L "Apache License" {} \;) | tee ./license_log.txt
26+
27+
- name: Save license log
28+
if: success()
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: licenselogs
32+
path: ./**/license_log.txt
33+
34+
- name: Fail if no headers
35+
run: if [ -s "./license_log.txt" ]; then echo "Some files are missing the license header"; exit 1; fi

.github/workflows/dotnet-build-and-release.yml

Lines changed: 60 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@ on:
88
type: string
99
default: 1.0.0 # for non-released builds
1010
release_url:
11-
description: The url to upload a publsihed release
11+
description: The url to upload a published release
1212
required: false # leave empty for non-release build
1313
type: string
1414
release_dir:
1515
description: The relative directory inside the repo where the build artifacts to publish for release will be located
16+
required: true
17+
type: string
18+
release_project:
19+
description: The relative file location for csproj
1620
required: false
1721
type: string
1822
integration_type:
@@ -55,7 +59,7 @@ jobs:
5559
5660
echo "release_dir: ${{ inputs.release_dir }}"
5761
58-
$creatingRelease = ("${{ inputs.release_url }}".Trim().Length -gt 0) -and ("${{ inputs.release_dir }}".Trim().Length -gt 0)
62+
$creatingRelease = "${{ inputs.release_url }}".Trim().Length -gt 0
5963
echo "Flagged to create release: ${creatingRelease}"
6064
echo "CREATE_RELEASE=${creatingRelease}" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append
6165
@@ -74,6 +78,7 @@ jobs:
7478
if ($assemblyInfoFiles -ne $null)
7579
{
7680
$newVer = "${{ inputs.release_version || '1.0.0' }}".TrimStart('v').Split('-')[0]
81+
echo "newver=${newVer}" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append
7782
echo "Prepared to overwrite Assembly version to: ${newVer}"
7883
foreach ($assemblyInfoFile in $assemblyInfoFiles)
7984
{
@@ -88,37 +93,64 @@ jobs:
8893
$newVer = "${{ inputs.release_version || '1.0.0' }}".TrimStart('v').Split('-')[0]
8994
MSBuild.exe $Env:SOLUTION_PATH -p:RestorePackagesConfig=false -p:Configuration=Release -p:Version=$newVer
9095
91-
- name: Check for manifest
92-
if: success() && env.CREATE_RELEASE == 'True' && inputs.integration_type == 'orchestrator'
96+
- name: Read Target Frameworks
97+
id: read_target_frameworks
98+
shell: pwsh
9399
run: |
94-
$fileExists = Get-ChildItem -Path ${{ github.workspace }}\${{ inputs.release_dir }} -Recurse -Filter 'manifest.json' | Select-Object -First 1
95-
if (-not $fileExists) { exit 1 }
100+
[xml]$csproj = Get-Content "${{ inputs.release_project }}"
101+
$targetFrameworks = $csproj.Project.PropertyGroup.TargetFrameworks
102+
if ($null -eq $targetFrameworks) {
103+
$targetFrameworks = $csproj.Project.PropertyGroup.TargetFramework
104+
}
105+
echo "release_platforms: $targetFrameworks"
106+
echo "release_platforms=$targetFrameworks" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append
96107
97108
- name: Archive Files
98109
if: success() && env.CREATE_RELEASE == 'True'
110+
shell: pwsh
99111
run: |
100-
md ${{ github.workspace }}\zip\Keyfactor
101-
Compress-Archive -Path `
102-
${{ github.workspace }}\${{ inputs.release_dir }}\ `
103-
-DestinationPath ${{ github.workspace }}\zip\Keyfactor\$Env:REPO_NAME.zip -Force
104-
105-
- name: Upload Release Asset (x64)
112+
$platforms = "${{ env.release_platforms }}".Split(';')
113+
$outputDir = "${{ github.workspace }}\zip\Keyfactor"
114+
echo "outputDir=$outputDir" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append
115+
if (Test-Path $outputDir) {
116+
Remove-Item -Recurse -Force $outputDir
117+
}
118+
md $outputDir
119+
foreach ($platform in $platforms) {
120+
$platform = $platform.Trim()
121+
$sourcePath = "${{ github.workspace }}\${{ inputs.release_dir }}\$platform\"
122+
$zipPath = "$outputDir\${{ env.REPO_NAME }}_${{ inputs.release_version }}_$platform.zip"
123+
Get-ChildItem -File -Path $sourcePath
124+
Compress-Archive -Path $sourcePath -DestinationPath $zipPath -Force -Verbose
125+
}
126+
Get-ChildItem -File -Path $outputDir
127+
$buildFiles = Get-ChildItem -File -Path $outputDir -Name
128+
$releaseArtifacts
129+
foreach ($zipFile in $buildFiles) {
130+
$releaseArtifacts = $releaseArtifacts + $outputDir + "\" + $zipFile + [Environment]::NewLine
131+
}
132+
echo "release_artifacts: $releaseArtifacts"
133+
echo "Writing in as multiline github env variable"
134+
echo "release_artifacts<<EOF" >> $env:GITHUB_ENV
135+
echo "$releaseArtifacts" >> $env:GITHUB_ENV
136+
echo "EOF" >> $env:GITHUB_ENV
137+
138+
- name: Release Asset(s)
139+
uses: softprops/action-gh-release@v2
106140
if: success() && env.CREATE_RELEASE == 'True'
107-
id: upload-release-asset-x64
108-
uses: keyfactor/upload-release-assets@v1
109-
env:
110-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
111141
with:
112-
upload_url: ${{ inputs.release_url }}
113-
asset_path: ${{ github.workspace }}\zip\Keyfactor\${{ env.REPO_NAME}}.zip
114-
asset_name: ${{ env.REPO_NAME}}_${{ inputs.release_version }}.zip
115-
asset_content_type: application/zip
116-
117-
- name: Delete Failed Release
118-
if: failure() && env.CREATE_RELEASE == 'True'
119-
id: delete-failed-release
120-
env:
121-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
122-
run: |
123-
gh release delete ${{ inputs.release_version }} --yes --cleanup-tag
142+
repository: ${{ github.repository }}
143+
files: |
144+
${{ env.release_artifacts }}
145+
append_body: true
146+
tag_name: ${{ inputs.release_version }}
147+
token: ${{ secrets.token }}
148+
149+
# - name: Delete Failed Release
150+
# if: failure() && env.CREATE_RELEASE == 'True'
151+
# id: delete-failed-release
152+
# env:
153+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
154+
# run: |
155+
# gh release delete ${{ inputs.release_version }} --yes --cleanup-tag
124156

.github/workflows/github-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ on:
2020

2121
jobs:
2222
call-check-file-action:
23-
uses: keyfactor/cpr-release-checks/.github/workflows/check-files.yml@main
23+
uses: keyfactor/actions/.github/workflows/check-todos-license-headers.yml@v3
2424

2525
create-github-release-workflow:
2626
runs-on: ubuntu-latest
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Semantic Release
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 20
19+
20+
- name: Download Artifacts
21+
uses: actions/download-artifact@v4
22+
with:
23+
path: ./artifacts # Download artifacts to this directory
24+
25+
- name: Create package.json
26+
run: |
27+
echo '{"version": "1.0.0"}' > package.json
28+
29+
- name: Install dependencies
30+
run: npm install --save-dev semantic-release @semantic-release/git @semantic-release/changelog
31+
32+
# - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
33+
# run: npm audit signatures
34+
35+
# Create a new release using the rules in .releaserc.yml
36+
- name: Release
37+
env:
38+
GH_TOKEN: ${{ secrets.V2BUILDTOKEN }}
39+
run: npx semantic-release
40+
#if: github.ref == 'refs/heads/main'

.github/workflows/starter.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ jobs:
118118
release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }}
119119
release_url: ${{ needs.call-create-github-release-workflow.outputs.release_url }}
120120
release_dir: ${{ needs.call-assign-from-json-workflow.outputs.release_dir }}
121+
release_project: ${{ needs.call-assign-from-json-workflow.outputs.release_project }}
121122
integration_type: ${{ needs.call-assign-from-json-workflow.outputs.integration_type }}
122123
secrets:
123124
token: ${{ secrets.token }}

.releaserc.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
branches:
3+
- name: main
4+
prerelease: false
5+
- name: '.*'
6+
prerelease: true
7+
8+
9+
ci: true
10+
tagFormat: "${version}"
11+
plugins:
12+
- "@semantic-release/commit-analyzer"
13+
- "@semantic-release/release-notes-generator"
14+
- "@semantic-release/changelog"
15+
- "@semantic-release/git"
16+
- "@semantic-release/github"
17+
18+
verifyConditions:
19+
- "@semantic-release/changelog"
20+
- '@semantic-release/git'
21+
- "@semantic-release/github"
22+
analyzeCommits:
23+
- path: "@semantic-release/commit-analyzer"
24+
generateNotes:
25+
- path: "@semantic-release/release-notes-generator"
26+
writerOpts:
27+
groupBy: "type"
28+
commitGroupsSort:
29+
- "title" # Sort by title
30+
- "feat" # Sort "feat" first
31+
- "fix" # Then sort "fix"
32+
- "chore" # Then sort "chore"
33+
- "docs" # Then sort "docs"
34+
- "refactor" # Then sort "refactor"
35+
commitsSort: "header"
36+
linkCompare: true
37+
linkReferences: true
38+
presetConfig: true
39+
prepare:
40+
- path: "@semantic-release/changelog"
41+
ifBranch: main
42+
- path: "@semantic-release/git"
43+
message: "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
44+
assets:
45+
- "CHANGELOG.md"
46+
- "README.md"
47+
- "artifacts/*"
48+
- "artifacts/**/*"
49+
50+
publish:
51+
- path: "@semantic-release/github"
52+
assets:
53+
- "CHANGELOG.md"
54+
- "README.md"
55+
- "artifacts/*"
56+
- "artifacts/**/*"
57+
58+
success:
59+
- "@semantic-release/github"
60+
61+
fail:
62+
- "@semantic-release/github"

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## [3.3.1](https://github.com/Keyfactor/actions/compare/3.3.0...3.3.1) (2025-06-23)
2+
3+
4+
### Bug Fixes
5+
6+
* **rename:** set workflow to .yml extension ([6daa700](https://github.com/Keyfactor/actions/commit/6daa700022d5492004ee5cffa23bddd25275fe40))
7+
8+
# [3.3.0](https://github.com/Keyfactor/actions/compare/3.2.0...3.3.0) (2025-06-23)
9+
10+
11+
### Bug Fixes
12+
13+
* **build:** syntax error in evaluated powershell ([04e3a8a](https://github.com/Keyfactor/actions/commit/04e3a8a93c1edb8339d7f87dff9b9a25c1392438))
14+
15+
16+
### Features
17+
18+
* **build:** populate release_dir for any build, allowing arbitrary integration_type ([c9e7a67](https://github.com/Keyfactor/actions/commit/c9e7a67b230f902367114b56de49f784891485b9))
19+
* **build:** prepare 3.3.0 for release and v3 tagging ([238c248](https://github.com/Keyfactor/actions/commit/238c24810a43ed4a981592d7259131585229b80f))
20+
21+
# 3.3.0 - tagged v3
22+
* allow any integration_type to generate a release build
23+
* update to use v3 tag throughout workflow steps
24+
* disable polaris scan (not configured correctly)
25+
26+
# [3.2.0](https://github.com/Keyfactor/actions/compare/3.1.2...3.2.0) (2025-05-08)
27+
28+
29+
### Bug Fixes
30+
31+
* **workflow:** Update semantic-release token. ([4673a86](https://github.com/Keyfactor/actions/commit/4673a86050903c689ce861df284735c515cac8ea))
32+
33+
34+
### Features
35+
36+
* **workflow:** Add semantic release ([0af8218](https://github.com/Keyfactor/actions/commit/0af82184f0be6700a23ae444f39c74d0de449567))

package-lock.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)