From 85ceea5da89c29964aee5fadb039965703518a9d Mon Sep 17 00:00:00 2001 From: Mikey Henderson Date: Sat, 28 Oct 2023 17:47:06 -0700 Subject: [PATCH 01/95] Support hotfixes (#56) * replace version/release tasks to support hotfixes * remove codesign step * update condition for create_release * set LATEST_TAG and update IS_HOTFIX detection * add new starter.yml called workflow * update SDK_SYNC_PAT to input:secret.token * detect empty tags list * Reformat manifest properties summary * use `` not $() --- .github/workflows/assign-env-from-json.yml | 11 +- .../workflows/dotnet-build-and-release.yml | 6 +- .github/workflows/github-release.yml | 206 +++++++++++------- .github/workflows/starter.yml | 82 +++++++ 4 files changed, 222 insertions(+), 83 deletions(-) create mode 100644 .github/workflows/starter.yml diff --git a/.github/workflows/assign-env-from-json.yml b/.github/workflows/assign-env-from-json.yml index 8704d2c..77d5a9c 100644 --- a/.github/workflows/assign-env-from-json.yml +++ b/.github/workflows/assign-env-from-json.yml @@ -92,10 +92,11 @@ jobs: - name: Write variables to Summary id: adding-final-markdown run: | - echo "### ${{ steps.read-name.outputs.output-property }} : ${{ steps.read-name.outputs.output-value }}" >> $GITHUB_STEP_SUMMARY - echo "### ${{ steps.read-type.outputs.output-property }} : ${{ steps.read-type.outputs.output-value }}" >> $GITHUB_STEP_SUMMARY - echo "### ${{ steps.read-update_catalog.outputs.output-property }} : ${{ steps.read-update_catalog.outputs.output-value }}" >> $GITHUB_STEP_SUMMARY - echo "### ${{ steps.read-UOFramework.outputs.output-property }} : ${{ steps.read-UOFramework.outputs.output-value }}" >> $GITHUB_STEP_SUMMARY - echo "### ${{ steps.read-release_dir.outputs.output-property }} : ${{ steps.read-release_dir.outputs.output-value }}" >> $GITHUB_STEP_SUMMARY + echo "### Integration Manifest Properties:" >> $GITHUB_STEP_SUMMARY + echo "* ${{ steps.read-name.outputs.output-property }} : ${{ steps.read-name.outputs.output-value }}" >> $GITHUB_STEP_SUMMARY + echo "* ${{ steps.read-type.outputs.output-property }} : ${{ steps.read-type.outputs.output-value }}" >> $GITHUB_STEP_SUMMARY + echo "* ${{ steps.read-update_catalog.outputs.output-property }} : ${{ steps.read-update_catalog.outputs.output-value }}" >> $GITHUB_STEP_SUMMARY + echo "* ${{ steps.read-UOFramework.outputs.output-property }} : ${{ steps.read-UOFramework.outputs.output-value }}" >> $GITHUB_STEP_SUMMARY + echo "* ${{ steps.read-release_dir.outputs.output-property }} : ${{ steps.read-release_dir.outputs.output-value }}" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/dotnet-build-and-release.yml b/.github/workflows/dotnet-build-and-release.yml index c210066..7157fbb 100644 --- a/.github/workflows/dotnet-build-and-release.yml +++ b/.github/workflows/dotnet-build-and-release.yml @@ -25,7 +25,7 @@ jobs: dotnet-build-and-release: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup dotnet uses: actions/setup-dotnet@v3 @@ -54,6 +54,10 @@ jobs: echo "Flagged to create release: ${creatingRelease}" echo "CREATE_RELEASE=${creatingRelease}" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append + $isPreRelease = "${{ github.base_ref }}".StartsWith("release-") -and [System.Convert]::ToBoolean("${{ github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') }}") + echo "Pre-release flagged: $($isPreRelease)" + echo "IS_PRE_RELEASE=$($isPreRelease)" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append + dotnet nuget add source https://nuget.pkg.github.com/Keyfactor/index.json -n github -u ${{ github.actor }} -p ${{ secrets.token }} --store-password-in-clear-text nuget restore $slnPath -Project2ProjectTimeout 240 diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index 8b4eca6..0c422d1 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -8,92 +8,144 @@ on: release_url: description: The upload URL for build artifacts for this release value: ${{ jobs.create-github-release.outputs.release_url }} + pull_request: + types: [opened, closed, synchronize] + push: jobs: call-create-github-release-workflow: uses: keyfactor/cpr-release-checks/.github/workflows/check-files.yml@main - - create-github-release: - runs-on: windows-latest + get-versions: + runs-on: ubuntu-latest outputs: - release_version: ${{ steps.create_release.outputs.current_tag }} - release_url: ${{ steps.create_release.outputs.upload_url }} - steps: - # determines values of repo name and major.minor release version from branch, and if build should be Releasor Pre-Release - # full release is run on on Push to a release- branch, and requires that branch protection prevent regular pushes from triggering a release - # there is no clear way to capture the 'pull_request' action closing with a merge when the calling workflow has a check for 'push' - the push of the merge is captured and not the pull_request closing - - name: Get release values from workflow state - run: | - $repoName = "${{ github.repository }}".Split("/") - echo "Repo Name: $($repoName[-1])" - echo "REPO_NAME=$($repoName[-1])" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append + PR_BASE_REF: ${{ steps.set-outputs.outputs.PR_BASE_REF }} + PR_COMMIT_SHA: ${{ steps.set-outputs.outputs.PR_COMMIT_SHA }} + GITHUB_SHA: ${{ steps.set-outputs.outputs.GITHUB_SHA }} + PR_BASE_TAG: ${{ steps.set-outputs.outputs.PR_BASE_TAG }} + IS_FULL_RELEASE: ${{ steps.set-outputs.outputs.IS_FULL_RELEASE }} + IS_PRE_RELEASE: ${{ steps.set-outputs.outputs.IS_PRE_RELEASE }} + INC_LEVEL: ${{ steps.set-outputs.outputs.INC_LEVEL }} + IS_RELEASE_BRANCH: ${{ steps.set-outputs.outputs.IS_RELEASE_BRANCH }} + IS_HOTFIX: ${{ steps.set-outputs.outputs.IS_HOTFIX }} + LATEST_TAG: ${{ steps.set-outputs.outputs.LATEST_TAG }} + - $relVersion = "${{ github.base_ref }}".Split("-") - echo "Release Version: $($relVersion[-1])" - echo "RELEASE_VERSION=$($relVersion[-1])" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append + steps: + - name: Check out the code + uses: actions/checkout@v3 - $isPreRelease = "${{ github.base_ref }}".StartsWith("release-") -and [System.Convert]::ToBoolean("${{ github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') }}") - echo "Pre-release flagged: $($isPreRelease)" - echo "IS_PRE_RELEASE=$($isPreRelease)" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append + - name: Display base.ref from Pull Request + if: github.event_name == 'pull_request' + id: display-from-pr + run: | + echo "Event: ${{ github.event_name }}" | tee -a $GITHUB_STEP_SUMMARY + echo "Event Action: ${{ github.event.action }}" | tee -a $GITHUB_STEP_SUMMARY + echo "PR_BASE_REF=${{ github.event.pull_request.base.ref }}" | tee -a "$GITHUB_ENV" | tee -a $GITHUB_STEP_SUMMARY + echo "PR_STATE=${{ github.event.pull_request.state }}" | tee -a "$GITHUB_ENV" | tee -a $GITHUB_STEP_SUMMARY + echo "PR_MERGED=${{ github.event.pull_request.merged }}" | tee -a "$GITHUB_ENV" | tee -a $GITHUB_STEP_SUMMARY + echo "PR_COMMIT_SHA=${{ github.event.pull_request.merge_commit_sha }}" | tee -a "$GITHUB_ENV" | tee -a $GITHUB_STEP_SUMMARY + echo "GITHUB_SHA=${{ github.sha }}" | tee -a "$GITHUB_ENV" | tee -a $GITHUB_STEP_SUMMARY + baseref="${{ github.event.pull_request.base.ref }}" + basetag="${baseref#release-}" + echo "PR_BASE_TAG=$basetag" | tee -a "$GITHUB_ENV" | tee -a $GITHUB_STEP_SUMMARY - # checks if pre-release patch version can be determined from existing release tags or if we start at 0 - - name: GitHub Script checks for existing version tags - id: existing_version - uses: actions/github-script@v6 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VERSION_NUMBER: ${{ env.RELEASE_VERSION }} - if: env.IS_PRE_RELEASE == 'True' - with: - script: | - // check for existing tags on this major.minor version - const tagsList = await github.rest.git.listMatchingRefs({ - owner: context.repo.owner, - repo: context.repo.repo, - ref: 'tags' - }); - - const { VERSION_NUMBER } = process.env; - const tags = tagsList.data.reverse(); - - // assume linear release pattern - i.e. always working on latest major.minor version - // if there are no tags, or latest tag does not start with VERSION_NUMBER, set a manual version for release - if (tags.length < 1 - || !tags.shift().ref.startsWith(`refs/tags/${VERSION_NUMBER}`)) { - core.exportVariable('MANUAL_VERSION', `${VERSION_NUMBER}.0-rc.0`); - } - - # if not a pre release, check if there is a pull request that has closed + merged with the commit SHA of this push - - name: GitHub Script checks for merged pull request - id: merged_pull_request - uses: actions/github-script@v6 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Display base_ref from Push Event if: github.event_name == 'push' - with: - script: | - // get all pull requests for this repo - const pulls = await github.rest.pulls.list({ - owner: context.repo.owner, - repo: context.repo.repo, - state: 'closed' - }); + id: display-from-push + run: | + echo "Branch Ref: ${{ github.ref }}" | tee -a $GITHUB_STEP_SUMMARY + echo "Event: ${{ github.event_name }}" | tee -a $GITHUB_STEP_SUMMARY + echo "github.sha: ${{ github.sha }}" | tee -a $GITHUB_STEP_SUMMARY - // get the state of the latest pull request for this repo - const state = pulls.data[0].state; - const mergeSHA = pulls.data[0].merge_commit_sha; - const targetBranchName = pulls.data[0].base.ref; - - const IS_RELEASE = (state == 'closed') && (mergeSHA == context.sha) && (targetBranchName.startsWith('release-')); + - name: Find Latest Tag + if: github.event_name == 'pull_request' + id: find-latest-tag + run: | + prbasetag="${{env.PR_BASE_TAG}}" + git fetch --tags + if [[ -n `git tag` ]]; then + echo "Setting vars" + allBranchTags=`git tag --sort=-v:refname | grep "$prbasetag" || echo ""` + allRepoTags=`git tag --sort=-v:refname` + branchTagBase=`git tag --sort=-v:refname | grep "$prbasetag" | grep -o '^[0-9.]*' | head -n 1 || echo ""` + latestTagBase=`git tag --sort=-v:refname | grep -o '^[0-9.]*' | head -n 1` + latestBranchTag=`git tag --sort=-v:refname | grep "$prbasetag" | grep "^$branchTagBase" | head -n 1 || echo ""` + latestReleasedTag=`git tag --sort=-v:refname | grep "$prbasetag" | grep "^$branchTagBase$" | head -n 1 || echo ""` - console.log(`State: ${state}`); - console.log(`mergeSHA: ${mergeSHA}`); - console.log(`pushSHA: ${context.sha}`); - console.log(`IS_RELEASE: ${IS_RELEASE}`); + # If the *TagBase values are not found in the list of tags, it means no final release was produced, and the latest*Tag vars will be empty + if [[ -z "$latestReleasedTag" ]]; then + latestTag="$latestBranchTag" + else + latestTag="$latestReleasedTag" + fi + echo "LATEST_TAG=${latestTag}" | tee -a "$GITHUB_ENV" - core.exportVariable('IS_RELEASE', `${IS_RELEASE}`); + if [[ "$latestTagBase" == *"$branchTagBase" ]]; then + hf="False" + else + hf="True" + fi - # Create a new release to auto-increment (or use manual version number) + # The intention is to use this to set the make_latest:false property when + # dispatching the create-release action, but it is not *yet* a configurable option + echo "IS_HOTFIX=$hf" | tee -a "$GITHUB_ENV" + else + echo "No tags exist in this repo" + echo "LATEST_TAG=" | tee -a "$GITHUB_ENV" + fi + - name: Set Outputs + if: github.event_name == 'pull_request' + id: set-outputs + run: | + echo "PR_BASE_REF=${{ env.PR_BASE_REF }}" | tee -a "$GITHUB_OUTPUT" + echo "PR_STATE=${{ env.PR_STATE }}" + echo "PR_MERGED=${{ env.PR_MERGED }}" + if [[ "${{ env.PR_STATE }}" == "closed" && "${{ env.PR_MERGED }}" == "true" && "${{ env.PR_COMMIT_SHA }}" == "${{ env.GITHUB_SHA }}" ]]; then + echo "IS_FULL_RELEASE=True" | tee -a "$GITHUB_OUTPUT" + echo "INC_LEVEL=patch" | tee -a "$GITHUB_OUTPUT" + fi + if [[ "${{ env.PR_STATE }}" == "open" ]]; then + echo "IS_PRE_RELEASE=True" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" + echo "INC_LEVEL=prerelease" | tee -a "$GITHUB_OUTPUT" + fi + if [[ "${{ env.PR_BASE_REF }}" == "release-"* ]]; then + echo "IS_RELEASE_BRANCH=True" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" + fi + echo "PR_COMMIT_SHA=${{ env.PR_COMMIT_SHA }}" | tee -a "$GITHUB_OUTPUT" + echo "GITHUB_SHA=${{ env.GITHUB_SHA }}" | tee -a "$GITHUB_OUTPUT" + echo "PR_BASE_TAG=${{ env.PR_BASE_TAG }}" | tee -a "$GITHUB_OUTPUT" + echo "IS_HOTFIX=${{ env.IS_HOTFIX }}" | tee -a "$GITHUB_OUTPUT" + echo "LATEST_TAG=${{ env.LATEST_TAG }}" | tee -a "$GITHUB_OUTPUT" + + create-github-release: + needs: get-versions + if: github.event_name == 'pull_request' && needs.get-versions.outputs.IS_RELEASE_BRANCH == 'True' + outputs: + release_version: ${{ steps.create_release.outputs.current_tag }} + release_url: ${{ steps.create_release.outputs.upload_url }} + runs-on: ubuntu-latest + steps: + - run: | + echo "INC_LEVEL=${{ needs.get-versions.outputs.INC_LEVEL}}" + - name: Check if initial release + if: needs.get-versions.outputs.LATEST_TAG == '' + run: | + echo "INITIAL_VERSION=${{needs.get-versions.outputs.PR_BASE_TAG}}.0-rc.0" | tee -a "$GITHUB_STEP_SUMMARY" | tee -a "$GITHUB_ENV" + echo "MANUAL_VERSION=${{needs.get-versions.outputs.PR_BASE_TAG}}.0-rc.0" | tee -a "$GITHUB_ENV" + - name: Set semver info + id: set-semver-info + if: needs.get-versions.outputs.LATEST_TAG != '' + uses: fiddlermikey/action-bump-semver@main + with: + current_version: ${{ needs.get-versions.outputs.LATEST_TAG}} + level: ${{ needs.get-versions.outputs.INC_LEVEL}} + preID: rc + - name: Show next sem-version + if: needs.get-versions.outputs.LATEST_TAG != '' + run: | + echo "MANUAL_VERSION=${{ steps.set-semver-info.outputs.new_version }}" > "$GITHUB_ENV" + - run: | + echo "Next version: ${{ env.MANUAL_VERSION }}" | tee -a "$GITHUB_STEP_SUMMARY" - name: Create new release id: create_release # uses: keyfactor/action-create-release@upd-deprecated @@ -101,17 +153,17 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} MANUAL_VERSION: ${{ env.MANUAL_VERSION }} - if: env.IS_PRE_RELEASE == 'True' || env.IS_RELEASE == 'true' + if: github.event_name == 'pull_request' && needs.get-versions.outputs.IS_RELEASE_BRANCH == 'True' with: - release_name: ${{ env.RELEASE_VERSION }} + release_name: ${{ env.MANUAL_VERSION }} body: | [Changelog](/./CHANGELOG.md) [Readme](/./README.md) For the latest README.md updates visit the [Main Page](/../main) for this repository draft: false - prerelease: ${{ env.IS_PRE_RELEASE == 'True' }} + prerelease: ${{ needs.get-versions.outputs.IS_PRE_RELEASE == 'True'}} prerelease_suffix: rc tag_name: ${{ env.MANUAL_VERSION }} - auto_increment_type: ${{ (env.IS_PRE_RELEASE == 'True') && 'prerelease' || 'patch' }} + auto_increment_type: ${{ (needs.get-versions.outputs.IS_PRE_RELEASE == 'True') && 'prerelease' || 'patch' }} tag_schema: semantic commitish: ${{ github.sha }} diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml new file mode 100644 index 0000000..c7cec14 --- /dev/null +++ b/.github/workflows/starter.yml @@ -0,0 +1,82 @@ +name: Bootstrap Starter Workflow +on: + workflow_call: + #inputs: + # buildtype: + # description: 'Platform to build' + # required: true + # type: string + # release_dir: + # description: 'release_dir property from integration-manifest.json' + # required: true + # type: string + # update_catalog: + # description: 'update_catalog property from integration-manifest.json' + # required: true + # type: string + secrets: + token: + description: 'GitHub token' + required: true + +jobs: + call-assign-from-json-workflow: + uses: Keyfactor/actions/.github/workflows/assign-env-from-json.yml@main + + call-get-primary-language: + outputs: + primary_language: ${{ steps.read.outputs.primary_language }} + runs-on: ubuntu-latest + name: Detect Primary Language + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + token: ${{ secrets.token }} + - name: Read primary language + id: read + uses: fiddlermikey/action-get-primary-language@v1.0 + with: + token: ${{ secrets.token }} + - name: Display type + id: display + run: | + echo "primary_language=${{ steps.read.outputs.primary_language}}" | tee -a "$GITHUB_OUTPUT" | tee -a $GITHUB_STEP_SUMMARY + + call-create-github-release-workflow: + uses: Keyfactor/actions/.github/workflows/github-release.yml@support-hotfixes + + call-dotnet-build-and-release-workflow: + needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow] + if: needs.call-get-primary-language.outputs.primary_language == 'C#' + uses: keyfactor/actions/.github/workflows/dotnet-build-and-release.yml@support-hotfixes + with: + release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} + release_url: ${{ needs.call-create-github-release-workflow.outputs.release_url }} + release_dir: ${{ needs.call-assign-from-json-workflow.outputs.release_dir }} + + secrets: + token: ${{ secrets.token }} + + call-go-build-and-tag-workflow: + needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow] + if: needs.call-get-primary-language.outputs.primary_language == 'Go' + uses: fiddlermikey/actions/.github/workflows/go-build-and-tag.yml@dev + with: + release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} + + + secrets: + token: ${{ secrets.token }} + + #call-generate-readme-workflow: + # if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' + # uses: Keyfactor/actions/.github/workflows/generate-readme.yml@main + # secrets: + # token: ${{ secrets.APPROVE_README_PUSH }} + + #call-update-catalog-workflow: + # if: inputs.update_catalog == 'True' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') + # uses: Keyfactor/actions/.github/workflows/update-catalog.yml@main + # secrets: + # token: ${{ secrets.SDK_SYNC_PAT }} From 50e2baddbc4b63ce63f2e467da5547f1a86fc1fc Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Sat, 28 Oct 2023 18:14:56 -0700 Subject: [PATCH 02/95] uncomment readme/catalog targets --- .github/workflows/starter.yml | 36 ++++++++++------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index c7cec14..fd0142a 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -1,19 +1,6 @@ name: Bootstrap Starter Workflow on: workflow_call: - #inputs: - # buildtype: - # description: 'Platform to build' - # required: true - # type: string - # release_dir: - # description: 'release_dir property from integration-manifest.json' - # required: true - # type: string - # update_catalog: - # description: 'update_catalog property from integration-manifest.json' - # required: true - # type: string secrets: token: description: 'GitHub token' @@ -54,7 +41,6 @@ jobs: release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} release_url: ${{ needs.call-create-github-release-workflow.outputs.release_url }} release_dir: ${{ needs.call-assign-from-json-workflow.outputs.release_dir }} - secrets: token: ${{ secrets.token }} @@ -64,19 +50,17 @@ jobs: uses: fiddlermikey/actions/.github/workflows/go-build-and-tag.yml@dev with: release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} - - secrets: token: ${{ secrets.token }} - #call-generate-readme-workflow: - # if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' - # uses: Keyfactor/actions/.github/workflows/generate-readme.yml@main - # secrets: - # token: ${{ secrets.APPROVE_README_PUSH }} + call-generate-readme-workflow: + if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' + uses: Keyfactor/actions/.github/workflows/generate-readme.yml@main + secrets: + token: ${{ secrets.APPROVE_README_PUSH }} - #call-update-catalog-workflow: - # if: inputs.update_catalog == 'True' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') - # uses: Keyfactor/actions/.github/workflows/update-catalog.yml@main - # secrets: - # token: ${{ secrets.SDK_SYNC_PAT }} + call-update-catalog-workflow: + if: inputs.update_catalog == 'True' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') + uses: Keyfactor/actions/.github/workflows/update-catalog.yml@main + secrets: + token: ${{ secrets.SDK_SYNC_PAT }} From 39a1486bc8b11af5f2891a23d0170306be143088 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Sat, 28 Oct 2023 18:23:07 -0700 Subject: [PATCH 03/95] add readme token --- .github/workflows/starter.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index fd0142a..73811ef 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -5,6 +5,9 @@ on: token: description: 'GitHub token' required: true + APPROVE_README_PUSH: + description: 'Token to add-and-commit generated readme' + required: true jobs: call-assign-from-json-workflow: From b0e5b7a1afd8207d054d767f32fdcaf2176cf0c8 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Tue, 31 Oct 2023 15:15:25 -0700 Subject: [PATCH 04/95] move all actions to v2 --- .github/workflows/starter.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index 73811ef..eb3895b 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -11,7 +11,7 @@ on: jobs: call-assign-from-json-workflow: - uses: Keyfactor/actions/.github/workflows/assign-env-from-json.yml@main + uses: Keyfactor/actions/.github/workflows/assign-env-from-json.yml@v2 call-get-primary-language: outputs: @@ -34,12 +34,12 @@ jobs: echo "primary_language=${{ steps.read.outputs.primary_language}}" | tee -a "$GITHUB_OUTPUT" | tee -a $GITHUB_STEP_SUMMARY call-create-github-release-workflow: - uses: Keyfactor/actions/.github/workflows/github-release.yml@support-hotfixes + uses: Keyfactor/actions/.github/workflows/github-release.yml@v2 call-dotnet-build-and-release-workflow: needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow] if: needs.call-get-primary-language.outputs.primary_language == 'C#' - uses: keyfactor/actions/.github/workflows/dotnet-build-and-release.yml@support-hotfixes + uses: keyfactor/actions/.github/workflows/dotnet-build-and-release.yml@v2 with: release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} release_url: ${{ needs.call-create-github-release-workflow.outputs.release_url }} @@ -50,7 +50,7 @@ jobs: call-go-build-and-tag-workflow: needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow] if: needs.call-get-primary-language.outputs.primary_language == 'Go' - uses: fiddlermikey/actions/.github/workflows/go-build-and-tag.yml@dev + uses: fiddlermikey/actions/.github/workflows/go-build-and-tag.yml@v2 with: release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} secrets: From 2c1e5f4029937757f53f2e6d242df74f8ddca52b Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Tue, 31 Oct 2023 15:24:30 -0700 Subject: [PATCH 05/95] update go build placeholders --- .github/workflows/go-build-and-release.yml | 11 +++++++++++ .github/workflows/starter.yml | 2 +- tmp.js | 0 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/go-build-and-release.yml delete mode 100644 tmp.js diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml new file mode 100644 index 0000000..57a8863 --- /dev/null +++ b/.github/workflows/go-build-and-release.yml @@ -0,0 +1,11 @@ +name: Go build placeholder + +on: + workflow_dispatch: + +jobs: + call-starter-workflow: + runs-on: ubuntu-latest + steps: + - name: Go Build Placeholder + run: echo "Go Build Placeholder" diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index eb3895b..c4fd668 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -50,7 +50,7 @@ jobs: call-go-build-and-tag-workflow: needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow] if: needs.call-get-primary-language.outputs.primary_language == 'Go' - uses: fiddlermikey/actions/.github/workflows/go-build-and-tag.yml@v2 + uses: fiddlermikey/actions/.github/workflows/go-build-and-release.yml@v2 with: release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} secrets: diff --git a/tmp.js b/tmp.js deleted file mode 100644 index e69de29..0000000 From 8489a21c1ddc9fdfaf328e9f0ee19826b864c248 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Tue, 31 Oct 2023 15:27:00 -0700 Subject: [PATCH 06/95] update org for go-build-and-release --- .github/workflows/starter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index c4fd668..a157f1b 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -50,7 +50,7 @@ jobs: call-go-build-and-tag-workflow: needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow] if: needs.call-get-primary-language.outputs.primary_language == 'Go' - uses: fiddlermikey/actions/.github/workflows/go-build-and-release.yml@v2 + uses: keyfactor/actions/.github/workflows/go-build-and-release.yml@v2 with: release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} secrets: From 3db9e73acc34e24dc7fa16e56435d0de35b46309 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Tue, 31 Oct 2023 15:28:30 -0700 Subject: [PATCH 07/95] update trigger for go yml --- .github/workflows/go-build-and-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index 57a8863..a0298de 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -1,7 +1,7 @@ name: Go build placeholder on: - workflow_dispatch: + workflow_call: jobs: call-starter-workflow: From e917f10c19fd6bec0b07f4873d281537d6870a28 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Tue, 31 Oct 2023 15:36:35 -0700 Subject: [PATCH 08/95] add required inputs/with statements --- .github/workflows/go-build-and-release.yml | 18 ++++++++++++++++++ .github/workflows/starter.yml | 2 ++ 2 files changed, 20 insertions(+) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index a0298de..4f90d47 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -2,6 +2,24 @@ name: Go build placeholder on: workflow_call: + inputs: + release_version: + description: The release version to use when publishing a build + required: false + type: string + default: 1.0.0 # for non-released builds + release_url: + description: The url to upload a publsihed release + required: false # leave empty for non-release build + type: string + release_dir: + description: The relative directory inside the repo where the build artifacts to publish for release will be located + required: false # leave empty for non-release build + type: string + secrets: + token: + description: 'Secret token from caller workflow to access private packages' + required: true jobs: call-starter-workflow: diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index a157f1b..ce5f945 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -53,6 +53,8 @@ jobs: uses: keyfactor/actions/.github/workflows/go-build-and-release.yml@v2 with: release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} + release_url: ${{ needs.call-create-github-release-workflow.outputs.release_url }} + release_dir: ${{ needs.call-assign-from-json-workflow.outputs.release_dir }} secrets: token: ${{ secrets.token }} From a5de641d3beb65c27a0b9626f8526a28b6187cef Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Wed, 1 Nov 2023 10:09:44 -0700 Subject: [PATCH 09/95] Test prerelease delete --- .github/workflows/kf-delete-prereleases.yml | 22 ++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/kf-delete-prereleases.yml b/.github/workflows/kf-delete-prereleases.yml index cfa4c21..51410ce 100644 --- a/.github/workflows/kf-delete-prereleases.yml +++ b/.github/workflows/kf-delete-prereleases.yml @@ -1,19 +1,27 @@ -name: Delete Prereleases +name: Post Release Tasks on: workflow_call: secrets: token: - description: 'Secret token from caller workflow to access SDK repo' + description: 'Secret token from caller workflow to access repo' required: true jobs: - read_type: + remove_prereleases: runs-on: ubuntu-latest - name: A test job to delete prereleases from a repository + name: Deleting prereleases steps: - - name: Delete Prereleases - id: delete - uses: keyfactor/action-delete-prereleases@v1.0 + - name: Checkout + uses: actions/checkout@v3 with: repo-token: ${{ secrets.token}} + - name: Run delete-prereleases action + id: run-delete + uses: keyfactor/action-delete-prereleases@dev + with: + repo-token: ${{ secrets.token}} + - name: Display type + id: display + run: | + echo ${{ steps.run-delete.output.repo-names}} From f4ff40dc8339762d9d952cca8876822cc2ff490e Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Wed, 1 Nov 2023 10:31:24 -0700 Subject: [PATCH 10/95] minor cleanup --- .github/workflows/kf-delete-prereleases.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kf-delete-prereleases.yml b/.github/workflows/kf-delete-prereleases.yml index 51410ce..ecbbd57 100644 --- a/.github/workflows/kf-delete-prereleases.yml +++ b/.github/workflows/kf-delete-prereleases.yml @@ -15,7 +15,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 with: - repo-token: ${{ secrets.token}} + token: ${{ secrets.token}} - name: Run delete-prereleases action id: run-delete uses: keyfactor/action-delete-prereleases@dev From f69c677b6d8183342ffcfeb377f29dee2293a203 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Wed, 1 Nov 2023 10:40:09 -0700 Subject: [PATCH 11/95] use merged v1.0 branch action delete-prereleases --- .github/workflows/kf-delete-prereleases.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kf-delete-prereleases.yml b/.github/workflows/kf-delete-prereleases.yml index ecbbd57..3aff9b8 100644 --- a/.github/workflows/kf-delete-prereleases.yml +++ b/.github/workflows/kf-delete-prereleases.yml @@ -18,7 +18,7 @@ jobs: token: ${{ secrets.token}} - name: Run delete-prereleases action id: run-delete - uses: keyfactor/action-delete-prereleases@dev + uses: keyfactor/action-delete-prereleases@v1.0 with: repo-token: ${{ secrets.token}} - name: Display type From 030443a9f659afe31d64666157cfaf10c05eab34 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Wed, 1 Nov 2023 10:40:24 -0700 Subject: [PATCH 12/95] remove unused task --- .github/workflows/kf-delete-prereleases.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/kf-delete-prereleases.yml b/.github/workflows/kf-delete-prereleases.yml index 3aff9b8..04b711f 100644 --- a/.github/workflows/kf-delete-prereleases.yml +++ b/.github/workflows/kf-delete-prereleases.yml @@ -21,7 +21,3 @@ jobs: uses: keyfactor/action-delete-prereleases@v1.0 with: repo-token: ${{ secrets.token}} - - name: Display type - id: display - run: | - echo ${{ steps.run-delete.output.repo-names}} From 216185e9bb21273daaa41f74b0d70f111707e29b Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Wed, 1 Nov 2023 10:59:09 -0700 Subject: [PATCH 13/95] Pass outputs.IS_FULL_RELEASE for repo config tasks --- .github/workflows/github-release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index 0c422d1..fe471f5 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -8,6 +8,9 @@ on: release_url: description: The upload URL for build artifacts for this release value: ${{ jobs.create-github-release.outputs.release_url }} + IS_FULL_RELEASE: + description: The upload URL for build artifacts for this release + value: ${{ jobs.get-versions.outputs.IS_FULL_RELEASE }} pull_request: types: [opened, closed, synchronize] push: @@ -148,7 +151,6 @@ jobs: echo "Next version: ${{ env.MANUAL_VERSION }}" | tee -a "$GITHUB_STEP_SUMMARY" - name: Create new release id: create_release -# uses: keyfactor/action-create-release@upd-deprecated uses: keyfactor/action-create-release@v3 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 75bb09fac3f00568c979ff29174efe8777943075 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Thu, 2 Nov 2023 09:35:02 -0700 Subject: [PATCH 14/95] use 2.1 branch for dev/testing, add post-release cleanup workflow --- .github/workflows/starter.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index ce5f945..a28c421 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -11,7 +11,7 @@ on: jobs: call-assign-from-json-workflow: - uses: Keyfactor/actions/.github/workflows/assign-env-from-json.yml@v2 + uses: Keyfactor/actions/.github/workflows/assign-env-from-json.yml@release-2.1 call-get-primary-language: outputs: @@ -34,12 +34,12 @@ jobs: echo "primary_language=${{ steps.read.outputs.primary_language}}" | tee -a "$GITHUB_OUTPUT" | tee -a $GITHUB_STEP_SUMMARY call-create-github-release-workflow: - uses: Keyfactor/actions/.github/workflows/github-release.yml@v2 + uses: Keyfactor/actions/.github/workflows/github-release.yml@release-2.1 call-dotnet-build-and-release-workflow: needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow] if: needs.call-get-primary-language.outputs.primary_language == 'C#' - uses: keyfactor/actions/.github/workflows/dotnet-build-and-release.yml@v2 + uses: keyfactor/actions/.github/workflows/dotnet-build-and-release.yml@release-2.1 with: release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} release_url: ${{ needs.call-create-github-release-workflow.outputs.release_url }} @@ -50,7 +50,7 @@ jobs: call-go-build-and-tag-workflow: needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow] if: needs.call-get-primary-language.outputs.primary_language == 'Go' - uses: keyfactor/actions/.github/workflows/go-build-and-release.yml@v2 + uses: keyfactor/actions/.github/workflows/go-build-and-release.yml@release-2.1 with: release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} release_url: ${{ needs.call-create-github-release-workflow.outputs.release_url }} @@ -69,3 +69,11 @@ jobs: uses: Keyfactor/actions/.github/workflows/update-catalog.yml@main secrets: token: ${{ secrets.SDK_SYNC_PAT }} + + call-post-release-cleanup-workflow: + needs: [call-dotnet-build-and-release-workflow, call-assign-from-json-workflow, call-create-github-release-workflow] + if: needs.call-create-github-release-workflow.outputs.IS_FULL_RELEASE == 'True' + uses: Keyfactor/actions/.github/workflows/kf-post-release.yml@release-2.1 + secrets: + token: ${{ secrets.token }} + From 77c9e3d1b5e3c638dee16b95cb6e9173f8091297 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Thu, 2 Nov 2023 09:35:26 -0700 Subject: [PATCH 15/95] Add branch protection workflow --- .github/workflows/kf-configure-repo.yml | 61 +++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/kf-configure-repo.yml diff --git a/.github/workflows/kf-configure-repo.yml b/.github/workflows/kf-configure-repo.yml new file mode 100644 index 0000000..aa06309 --- /dev/null +++ b/.github/workflows/kf-configure-repo.yml @@ -0,0 +1,61 @@ +name: Configure Repository Release Branch Settings +############################################################################################# +# The following tasks should be performed whenever a release-* branch is created or updated +# - action-update-description +# - action-assign-topics +# - action-gh-teams-update +# - action-set-branch-protection +# - action-set-repo-license +############################################################################################# +on: + workflow_call: + secrets: + token: + description: 'Secret token from caller workflow to access repo' + required: true + create: + branches: + - 'release-*.*' + + +jobs: + configure_repo: + runs-on: ubuntu-latest + name: Updating repository settings + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + token: ${{ secrets.token}} + - name: Update topic from manifest:integration_type + id: update-topic + uses: keyfactor/action-assign-topics@v1.0 + with: + token: ${{ secrets.token}} + - name: Update description from manifest + id: update-description + uses: keyfactor/action-update-description@v1.0 + with: + token: ${{ secrets.token}} + - name: Update teams for non keyfactor-customer-private repos + id: update-teams + uses: keyfactor/action-gh-teams-update@v1.0 + with: + token: ${{ secrets.token}} + configure_branch: + runs-on: ubuntu-latest + name: Checkout the private action + steps: + - name: Checkout tools repo + uses: actions/checkout@v4 + with: + repository: keyfactor/action-set-branch-protection + path: my-tools + ref: v1 + token: ${{ secrets.token}} + - name: Update the branch protection in this repository for ${{ github.event.ref}} + id: update + uses: ./my-tools + with: + repo-token: ${{ secrets.token}} + protect-branch: ${{ github.event.ref}} From cb836abad26493d06379ae9defd4dd1eb8af5386 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Thu, 2 Nov 2023 09:43:49 -0700 Subject: [PATCH 16/95] comment out post-release step --- .github/workflows/starter.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index a28c421..98f6ca4 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -70,10 +70,10 @@ jobs: secrets: token: ${{ secrets.SDK_SYNC_PAT }} - call-post-release-cleanup-workflow: - needs: [call-dotnet-build-and-release-workflow, call-assign-from-json-workflow, call-create-github-release-workflow] - if: needs.call-create-github-release-workflow.outputs.IS_FULL_RELEASE == 'True' - uses: Keyfactor/actions/.github/workflows/kf-post-release.yml@release-2.1 - secrets: - token: ${{ secrets.token }} + #call-post-release-cleanup-workflow: + # needs: [call-dotnet-build-and-release-workflow, call-assign-from-json-workflow, call-create-github-release-workflow] + # if: needs.call-create-github-release-workflow.outputs.IS_FULL_RELEASE == 'True' + # uses: Keyfactor/actions/.github/workflows/kf-post-release.yml@release-2.1 + # secrets: + # token: ${{ secrets.token }} From 5e2a6959d9ad5edb110b7b9645f68d8245c4be86 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Thu, 2 Nov 2023 09:53:34 -0700 Subject: [PATCH 17/95] Add branch protection on create:release-*.* --- .github/workflows/kf-configure-repo.yml | 4 ---- .github/workflows/starter.yml | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/kf-configure-repo.yml b/.github/workflows/kf-configure-repo.yml index aa06309..fc08c9d 100644 --- a/.github/workflows/kf-configure-repo.yml +++ b/.github/workflows/kf-configure-repo.yml @@ -13,10 +13,6 @@ on: token: description: 'Secret token from caller workflow to access repo' required: true - create: - branches: - - 'release-*.*' - jobs: configure_repo: diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index 98f6ca4..c571201 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -70,6 +70,12 @@ jobs: secrets: token: ${{ secrets.SDK_SYNC_PAT }} + call-repository-configuration-workflow: + if: github.event_name == 'create' + uses: Keyfactor/actions/.github/workflows/kf-configure-repo.yml@release-2.1 + secrets: + token: ${{ secrets.token }} + #call-post-release-cleanup-workflow: # needs: [call-dotnet-build-and-release-workflow, call-assign-from-json-workflow, call-create-github-release-workflow] # if: needs.call-create-github-release-workflow.outputs.IS_FULL_RELEASE == 'True' From 6775492c3f7b62f26f8ffd4d1aeebf7026bead39 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Thu, 2 Nov 2023 10:51:27 -0700 Subject: [PATCH 18/95] use main for private repo --- .github/workflows/kf-configure-repo.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/kf-configure-repo.yml b/.github/workflows/kf-configure-repo.yml index fc08c9d..28e97b8 100644 --- a/.github/workflows/kf-configure-repo.yml +++ b/.github/workflows/kf-configure-repo.yml @@ -47,7 +47,6 @@ jobs: with: repository: keyfactor/action-set-branch-protection path: my-tools - ref: v1 token: ${{ secrets.token}} - name: Update the branch protection in this repository for ${{ github.event.ref}} id: update From 398cfeb8cf0ceb19be2c2bd7cb181dad5b836703 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Thu, 2 Nov 2023 11:50:02 -0700 Subject: [PATCH 19/95] pass token correctly --- .github/workflows/kf-configure-repo.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/kf-configure-repo.yml b/.github/workflows/kf-configure-repo.yml index 28e97b8..ea09e57 100644 --- a/.github/workflows/kf-configure-repo.yml +++ b/.github/workflows/kf-configure-repo.yml @@ -27,12 +27,12 @@ jobs: id: update-topic uses: keyfactor/action-assign-topics@v1.0 with: - token: ${{ secrets.token}} + repo-token: ${{ secrets.token}} - name: Update description from manifest id: update-description uses: keyfactor/action-update-description@v1.0 with: - token: ${{ secrets.token}} + repo-token: ${{ secrets.token}} - name: Update teams for non keyfactor-customer-private repos id: update-teams uses: keyfactor/action-gh-teams-update@v1.0 From 2ac0a95be180f28423cee7063f82bf9d373b15e7 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Thu, 2 Nov 2023 13:53:27 -0700 Subject: [PATCH 20/95] change job title --- .github/workflows/kf-configure-repo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kf-configure-repo.yml b/.github/workflows/kf-configure-repo.yml index ea09e57..d9f6240 100644 --- a/.github/workflows/kf-configure-repo.yml +++ b/.github/workflows/kf-configure-repo.yml @@ -40,7 +40,7 @@ jobs: token: ${{ secrets.token}} configure_branch: runs-on: ubuntu-latest - name: Checkout the private action + name: Configure branch protection steps: - name: Checkout tools repo uses: actions/checkout@v4 From 68493a630db42cdd04528065a0cd2e3e782be5d1 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Thu, 2 Nov 2023 13:55:46 -0700 Subject: [PATCH 21/95] use v2 tag --- .github/workflows/starter.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index c571201..f31dd73 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -11,7 +11,7 @@ on: jobs: call-assign-from-json-workflow: - uses: Keyfactor/actions/.github/workflows/assign-env-from-json.yml@release-2.1 + uses: Keyfactor/actions/.github/workflows/assign-env-from-json.yml@v2 call-get-primary-language: outputs: @@ -34,12 +34,12 @@ jobs: echo "primary_language=${{ steps.read.outputs.primary_language}}" | tee -a "$GITHUB_OUTPUT" | tee -a $GITHUB_STEP_SUMMARY call-create-github-release-workflow: - uses: Keyfactor/actions/.github/workflows/github-release.yml@release-2.1 + uses: Keyfactor/actions/.github/workflows/github-release.yml@v2 call-dotnet-build-and-release-workflow: needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow] if: needs.call-get-primary-language.outputs.primary_language == 'C#' - uses: keyfactor/actions/.github/workflows/dotnet-build-and-release.yml@release-2.1 + uses: keyfactor/actions/.github/workflows/dotnet-build-and-release.yml@v2 with: release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} release_url: ${{ needs.call-create-github-release-workflow.outputs.release_url }} @@ -50,7 +50,7 @@ jobs: call-go-build-and-tag-workflow: needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow] if: needs.call-get-primary-language.outputs.primary_language == 'Go' - uses: keyfactor/actions/.github/workflows/go-build-and-release.yml@release-2.1 + uses: keyfactor/actions/.github/workflows/go-build-and-release.yml@v2 with: release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} release_url: ${{ needs.call-create-github-release-workflow.outputs.release_url }} @@ -72,14 +72,14 @@ jobs: call-repository-configuration-workflow: if: github.event_name == 'create' - uses: Keyfactor/actions/.github/workflows/kf-configure-repo.yml@release-2.1 + uses: Keyfactor/actions/.github/workflows/kf-configure-repo.yml@v2 secrets: token: ${{ secrets.token }} #call-post-release-cleanup-workflow: # needs: [call-dotnet-build-and-release-workflow, call-assign-from-json-workflow, call-create-github-release-workflow] # if: needs.call-create-github-release-workflow.outputs.IS_FULL_RELEASE == 'True' - # uses: Keyfactor/actions/.github/workflows/kf-post-release.yml@release-2.1 + # uses: Keyfactor/actions/.github/workflows/kf-post-release.yml@v2 # secrets: # token: ${{ secrets.token }} From afc1f8bdc01d5264d26aba0fc32b3f3b9f684265 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Thu, 2 Nov 2023 14:22:29 -0700 Subject: [PATCH 22/95] Update configure-repo only on release-*.* branches --- .github/workflows/kf-configure-repo.yml | 3 +++ .github/workflows/starter.yml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/kf-configure-repo.yml b/.github/workflows/kf-configure-repo.yml index d9f6240..ef6ae24 100644 --- a/.github/workflows/kf-configure-repo.yml +++ b/.github/workflows/kf-configure-repo.yml @@ -13,6 +13,9 @@ on: token: description: 'Secret token from caller workflow to access repo' required: true + create: + branches: + - 'release-*.*' jobs: configure_repo: diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index f31dd73..a4a1a17 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -72,7 +72,7 @@ jobs: call-repository-configuration-workflow: if: github.event_name == 'create' - uses: Keyfactor/actions/.github/workflows/kf-configure-repo.yml@v2 + uses: Keyfactor/actions/.github/workflows/kf-configure-repo.yml@release-2.1 secrets: token: ${{ secrets.token }} From b3add2f4ea56ba65a85f783b458e80f577004716 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Thu, 2 Nov 2023 14:30:50 -0700 Subject: [PATCH 23/95] add condition to check for release- --- .github/workflows/starter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index a4a1a17..966d925 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -71,7 +71,7 @@ jobs: token: ${{ secrets.SDK_SYNC_PAT }} call-repository-configuration-workflow: - if: github.event_name == 'create' + if: github.event_name == 'create' && startsWith(github.ref, 'refs/heads/release-') uses: Keyfactor/actions/.github/workflows/kf-configure-repo.yml@release-2.1 secrets: token: ${{ secrets.token }} From 1b9ffdfe743f3b8f7fffc874018bb77c615c2669 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Thu, 2 Nov 2023 14:35:55 -0700 Subject: [PATCH 24/95] tag v2 --- .github/workflows/starter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index 966d925..4d1cd62 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -72,7 +72,7 @@ jobs: call-repository-configuration-workflow: if: github.event_name == 'create' && startsWith(github.ref, 'refs/heads/release-') - uses: Keyfactor/actions/.github/workflows/kf-configure-repo.yml@release-2.1 + uses: Keyfactor/actions/.github/workflows/kf-configure-repo.yml@v2 secrets: token: ${{ secrets.token }} From c913f18a8e6bd163de8462fafb489be995b57444 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Thu, 2 Nov 2023 15:50:31 -0700 Subject: [PATCH 25/95] update go builders and calling workflow --- .github/workflows/go-build-and-release.yml | 14 +++++++++++--- .github/workflows/starter.yml | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index 4f90d47..cd2973f 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -22,8 +22,16 @@ on: required: true jobs: - call-starter-workflow: + call-go-prerelease-workflow: + if: env.CREATE_RELEASE != 'True' runs-on: ubuntu-latest steps: - - name: Go Build Placeholder - run: echo "Go Build Placeholder" + - name: Go Build Prerelease Placeholder + run: echo "Go Build Prerelease Placeholder" + + call-go-release-workflow: + if: env.CREATE_RELEASE == 'True' + runs-on: ubuntu-latest + steps: + - name: Go Build Release Placeholder + run: echo "Go Build Release Placeholder" diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index 4d1cd62..3b9853c 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -50,7 +50,7 @@ jobs: call-go-build-and-tag-workflow: needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow] if: needs.call-get-primary-language.outputs.primary_language == 'Go' - uses: keyfactor/actions/.github/workflows/go-build-and-release.yml@v2 + uses: keyfactor/actions/.github/workflows/go-build-and-release.yml@release-2.1 with: release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} release_url: ${{ needs.call-create-github-release-workflow.outputs.release_url }} From 2a4afccc70842370d5cd546ab3dd7854cc5ecb97 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Thu, 2 Nov 2023 15:54:41 -0700 Subject: [PATCH 26/95] fix go build conditions --- .github/workflows/go-build-and-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index cd2973f..544790c 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -23,14 +23,14 @@ on: jobs: call-go-prerelease-workflow: - if: env.CREATE_RELEASE != 'True' + if: inputs.release_version == '' runs-on: ubuntu-latest steps: - name: Go Build Prerelease Placeholder run: echo "Go Build Prerelease Placeholder" call-go-release-workflow: - if: env.CREATE_RELEASE == 'True' + if: inputs.release_version != '' runs-on: ubuntu-latest steps: - name: Go Build Release Placeholder From 0d1eaf39491b4b039e3bf425b0f4d797c5909f5d Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Thu, 2 Nov 2023 20:06:09 -0700 Subject: [PATCH 27/95] replace go placeholder --- .github/workflows/go-build-and-release.yml | 36 +++++++++++++++------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index 544790c..5858ff9 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -8,14 +8,6 @@ on: required: false type: string default: 1.0.0 # for non-released builds - release_url: - description: The url to upload a publsihed release - required: false # leave empty for non-release build - type: string - release_dir: - description: The relative directory inside the repo where the build artifacts to publish for release will be located - required: false # leave empty for non-release build - type: string secrets: token: description: 'Secret token from caller workflow to access private packages' @@ -23,11 +15,33 @@ on: jobs: call-go-prerelease-workflow: - if: inputs.release_version == '' runs-on: ubuntu-latest steps: - - name: Go Build Prerelease Placeholder - run: echo "Go Build Prerelease Placeholder" + - uses: actions/checkout@v3 + with: + # Allow goreleaser to access older tag information. + fetch-depth: 0 + - uses: actions/setup-go@v4 + with: + go-version-file: 'go.mod' + cache: true + - name: get-is-release + run: | + if [[ -z ${{inputs.release_version}}]]; then + echo "IS_RELEASE=True" | tee -a "$GITHUB_ENV" | tee -a $GITHUB_STEP_SUMMARY; + echo "GO_ARGS=--skip-publish" | tee -a "$GITHUB_ENV" + else + echo "IS_RELEASE=False" | tee -a "$GITHUB_ENV" | tee -a $GITHUB_STEP_SUMMARY; + echo "GO_ARGS=" | tee -a "$GITHUB_ENV" + fi + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + args: ${{ env.GO_ARGS }} + env: + # GitHub sets the GITHUB_TOKEN secret automatically. + GITHUB_TOKEN: ${{ secrets.token }} + PAT_TOKEN: ${{ secrets.token }} call-go-release-workflow: if: inputs.release_version != '' From 38fa05f2d0a85bda6489691be203467d99f7a1a9 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Thu, 2 Nov 2023 20:10:09 -0700 Subject: [PATCH 28/95] go starter updates --- .github/workflows/starter.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index 3b9853c..357a2fc 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -53,8 +53,6 @@ jobs: uses: keyfactor/actions/.github/workflows/go-build-and-release.yml@release-2.1 with: release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} - release_url: ${{ needs.call-create-github-release-workflow.outputs.release_url }} - release_dir: ${{ needs.call-assign-from-json-workflow.outputs.release_dir }} secrets: token: ${{ secrets.token }} From 1aa501c40bcebccf6a6bfdca7d20fe65587f4e26 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Thu, 2 Nov 2023 20:18:11 -0700 Subject: [PATCH 29/95] fix if test --- .github/workflows/go-build-and-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index 5858ff9..25d8ec1 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -27,7 +27,7 @@ jobs: cache: true - name: get-is-release run: | - if [[ -z ${{inputs.release_version}}]]; then + if [[ -z "${{inputs.release_version}}" ]]; then echo "IS_RELEASE=True" | tee -a "$GITHUB_ENV" | tee -a $GITHUB_STEP_SUMMARY; echo "GO_ARGS=--skip-publish" | tee -a "$GITHUB_ENV" else From e83bb8c9228257ad25362167a5cbe2623a846721 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Thu, 2 Nov 2023 20:22:41 -0700 Subject: [PATCH 30/95] diff if --- .github/workflows/go-build-and-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index 25d8ec1..54e4ef2 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -27,7 +27,7 @@ jobs: cache: true - name: get-is-release run: | - if [[ -z "${{inputs.release_version}}" ]]; then + if [[ ""="${{inputs.release_version}}" ]]; then echo "IS_RELEASE=True" | tee -a "$GITHUB_ENV" | tee -a $GITHUB_STEP_SUMMARY; echo "GO_ARGS=--skip-publish" | tee -a "$GITHUB_ENV" else From 8fa86565e64078a42df435014981d626a024e5ee Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Thu, 2 Nov 2023 20:25:05 -0700 Subject: [PATCH 31/95] remove uneeded vars --- .github/workflows/go-build-and-release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index 54e4ef2..1fe9087 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -28,10 +28,8 @@ jobs: - name: get-is-release run: | if [[ ""="${{inputs.release_version}}" ]]; then - echo "IS_RELEASE=True" | tee -a "$GITHUB_ENV" | tee -a $GITHUB_STEP_SUMMARY; echo "GO_ARGS=--skip-publish" | tee -a "$GITHUB_ENV" else - echo "IS_RELEASE=False" | tee -a "$GITHUB_ENV" | tee -a $GITHUB_STEP_SUMMARY; echo "GO_ARGS=" | tee -a "$GITHUB_ENV" fi - name: Run GoReleaser From 5e8a647b1f91db615934cb27dd9f241bf8a0c0dd Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Thu, 2 Nov 2023 20:42:30 -0700 Subject: [PATCH 32/95] rookie mistake --- .github/workflows/go-build-and-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index 1fe9087..8138e1d 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -27,7 +27,7 @@ jobs: cache: true - name: get-is-release run: | - if [[ ""="${{inputs.release_version}}" ]]; then + if [[ ""=="${{inputs.release_version}}" ]]; then echo "GO_ARGS=--skip-publish" | tee -a "$GITHUB_ENV" else echo "GO_ARGS=" | tee -a "$GITHUB_ENV" From 60c9a2a3f9a26b5bd8420614f52f4f454f2fc8ff Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Fri, 3 Nov 2023 14:58:29 -0700 Subject: [PATCH 33/95] Make readme settings manditory --- readme-templates/readme.md.tpl | 19 ++++++++++--------- readme-templates/readme_platform_cagateway.md | 5 ++--- .../readme_platform_orchestrator.md | 2 -- readme-templates/readme_platform_pam.md | 4 +--- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/readme-templates/readme.md.tpl b/readme-templates/readme.md.tpl index 67e2b57..21df1e5 100644 --- a/readme-templates/readme.md.tpl +++ b/readme-templates/readme.md.tpl @@ -1,33 +1,34 @@ +{# Boilderplate section #} # {{ name }} {{ description }} #### Integration status: {{ shared.integration_status[status] }} -{% if ((integration_type == "ca-gateway") or (integration_type == "orchestrator") or (integration_type == "pam") or (integration_type == "terraform-provider") and (about is defined)) %} ## About the Keyfactor {{ shared.display_names[integration_type] }} {{ shared.descriptions[integration_type] }} -{% endif %} ## Support for {{ name }} {{ name }} {{ shared.support_statement[support_level] }} ###### To report a problem or suggest a new feature, use the **[Issues](../../issues)** tab. If you want to contribute actual bug fixes or proposed enhancements, use the **[Pull requests](../../pulls)** tab. - -{% if ((integration_type == "ca-gateway") or (integration_type == "orchestrator") or (integration_type == "pam") or (integration_type == "terraform-provider") and (about is defined)) %} +{# End of Boilderplate section #} +--- +{# Important information can go in the readme-pre.md to appear near the top of the document #} +{% include "./readme-src/readme-pre.md" ignore missing %} --- - {# Additional {{ integration_type }} platform template includes will go in this next section #} -{% if (integration_type == "orchestrator") and (about is defined) %} -{% include "./actions/readme-templates/readme_platform_orchestrator.md" ignore missing %} +{% if ((integration_type == "ca-gateway") or (integration_type == "orchestrator") or (integration_type == "pam") or (integration_type == "terraform-provider")) %} +{% if (integration_type == "orchestrator") %} +{% include "./actions/readme-templates/readme_platform_orchestrator.md" %} {% endif %} {% if (integration_type == "pam") and (about is defined) %} -{% include "./actions/readme-templates/readme_platform_pam.md" ignore missing %} +{% include "./actions/readme-templates/readme_platform_pam.md" %} {% endif %} {% if (integration_type == "ca-gateway") %} -{% include "./actions/readme-templates/readme_platform_cagateway.md" ignore missing %} +{% include "./actions/readme-templates/readme_platform_cagateway.md" %} {% endif %} --- {% endif %} diff --git a/readme-templates/readme_platform_cagateway.md b/readme-templates/readme_platform_cagateway.md index 180b5d9..ea38a58 100644 --- a/readme-templates/readme_platform_cagateway.md +++ b/readme-templates/readme_platform_cagateway.md @@ -1,6 +1,5 @@ -{% if gateway_framework is defined %} ## Keyfactor AnyGateway Framework Supported -This gateway was compiled against version {{ gateway_framework }} of the AnyGateway Framework. You will need at least this version of the AnyGateway Framework Installed. If you have a later AnyGateway Framework Installed you will probably need to add binding redirects in the CAProxyServer.exe.config file to make things work properly. -{% endif %} +This gateway was compiled against version {{ gateway_framework }} of the AnyGateway Framework. You will need at least this version of the AnyGateway Framework Installed. If you have a later AnyGateway Framework Installed you will probably need to add binding redirects in the CAProxyServer.exe.config file to make things work properly. + diff --git a/readme-templates/readme_platform_orchestrator.md b/readme-templates/readme_platform_orchestrator.md index 2c3d3a9..12b4eb1 100644 --- a/readme-templates/readme_platform_orchestrator.md +++ b/readme-templates/readme_platform_orchestrator.md @@ -1,8 +1,6 @@ -{% if about.orchestrator.UOFramework is defined %} ## Keyfactor Version Supported The minimum version of the Keyfactor Universal Orchestrator Framework needed to run this version of the extension is {{ about.orchestrator.UOFramework }} -{% endif %} ## Platform Specific Notes The Keyfactor Universal Orchestrator may be installed on either Windows or Linux based platforms. The certificate operations supported by a capability may vary based what platform the capability is installed on. The table below indicates what capabilities are supported based on which platform the encompassing Universal Orchestrator is running. diff --git a/readme-templates/readme_platform_pam.md b/readme-templates/readme_platform_pam.md index d96b8f1..cc4a44f 100644 --- a/readme-templates/readme_platform_pam.md +++ b/readme-templates/readme_platform_pam.md @@ -1,5 +1,3 @@ -{% include "./readme-src/readme-pre.md" ignore missing %} - ### Initial Configuration of PAM Provider In order to allow Keyfactor to use the new {{ name }}, the definition needs to be added to the application database. This is done by running the provided `kfutil` tool to install the PAM definition, which only needs to be done one time. It uses API credentials to access the Keyfactor instance and create the PAM definition. @@ -41,7 +39,7 @@ The Keyfactor service and IIS Server should be restarted after making these chan ``` -{% include "./readme-src/readme-register.md" ignore missing %} +{% include "./readme-src/readme-register.md" %} ##### Usage In order to use the PAM Provider, the provider's configuration must be set in the Keyfactor Platform. In the settings menu (upper right cog) you can select the ___Priviledged Access Management___ option to configure your provider instance. From a11c0bca51d10f5e5120e3c94d1e2011656c326e Mon Sep 17 00:00:00 2001 From: Mikey Henderson Date: Fri, 3 Nov 2023 21:43:21 -0700 Subject: [PATCH 34/95] make readme snippets and json properties manditory (#58) Co-authored-by: Michael Henderson From 1af2a102c46d76ff873564ed68c85de3526fa861 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Fri, 3 Nov 2023 21:53:11 -0700 Subject: [PATCH 35/95] Only assign UOFramework for orchestrators --- .github/workflows/assign-env-from-json.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/assign-env-from-json.yml b/.github/workflows/assign-env-from-json.yml index 77d5a9c..82b64cc 100644 --- a/.github/workflows/assign-env-from-json.yml +++ b/.github/workflows/assign-env-from-json.yml @@ -96,7 +96,9 @@ jobs: echo "* ${{ steps.read-name.outputs.output-property }} : ${{ steps.read-name.outputs.output-value }}" >> $GITHUB_STEP_SUMMARY echo "* ${{ steps.read-type.outputs.output-property }} : ${{ steps.read-type.outputs.output-value }}" >> $GITHUB_STEP_SUMMARY echo "* ${{ steps.read-update_catalog.outputs.output-property }} : ${{ steps.read-update_catalog.outputs.output-value }}" >> $GITHUB_STEP_SUMMARY - echo "* ${{ steps.read-UOFramework.outputs.output-property }} : ${{ steps.read-UOFramework.outputs.output-value }}" >> $GITHUB_STEP_SUMMARY + if [[ "${{ steps.read-type.outputs.output-value }}" == 'orchestrator' ]]; then + echo "* ${{ steps.read-UOFramework.outputs.output-property }} : ${{ steps.read-UOFramework.outputs.output-value }}" >> $GITHUB_STEP_SUMMARY + fi echo "* ${{ steps.read-release_dir.outputs.output-property }} : ${{ steps.read-release_dir.outputs.output-value }}" >> $GITHUB_STEP_SUMMARY From 8f79163adaacf1d232709ff96dbf3a91d7293f9a Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Fri, 3 Nov 2023 22:24:32 -0700 Subject: [PATCH 36/95] set --snapshot for all builds --- .github/workflows/go-build-and-release.yml | 19 +++---------------- .github/workflows/starter.yml | 4 +--- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index 8138e1d..3af6711 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -2,12 +2,6 @@ name: Go build placeholder on: workflow_call: - inputs: - release_version: - description: The release version to use when publishing a build - required: false - type: string - default: 1.0.0 # for non-released builds secrets: token: description: 'Secret token from caller workflow to access private packages' @@ -27,10 +21,10 @@ jobs: cache: true - name: get-is-release run: | - if [[ ""=="${{inputs.release_version}}" ]]; then - echo "GO_ARGS=--skip-publish" | tee -a "$GITHUB_ENV" + if [[ "${{ github.event_name == 'pull_request' }}" ]]; then + echo "GO_ARGS=--snapshot" | tee -a "$GITHUB_ENV" else - echo "GO_ARGS=" | tee -a "$GITHUB_ENV" + echo "GO_ARGS=--snapshot --skip-publish" | tee -a "$GITHUB_ENV" fi - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5 @@ -40,10 +34,3 @@ jobs: # GitHub sets the GITHUB_TOKEN secret automatically. GITHUB_TOKEN: ${{ secrets.token }} PAT_TOKEN: ${{ secrets.token }} - - call-go-release-workflow: - if: inputs.release_version != '' - runs-on: ubuntu-latest - steps: - - name: Go Build Release Placeholder - run: echo "Go Build Release Placeholder" diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index 357a2fc..83e0c29 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -47,12 +47,10 @@ jobs: secrets: token: ${{ secrets.token }} - call-go-build-and-tag-workflow: + call-go-build-and-release-workflow: needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow] if: needs.call-get-primary-language.outputs.primary_language == 'Go' uses: keyfactor/actions/.github/workflows/go-build-and-release.yml@release-2.1 - with: - release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} secrets: token: ${{ secrets.token }} From 4745a8fabc10b29de5723f30c9411cc5ae1f88b1 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Fri, 3 Nov 2023 22:26:29 -0700 Subject: [PATCH 37/95] json step summary update --- .github/workflows/starter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index 83e0c29..f21148e 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -11,7 +11,7 @@ on: jobs: call-assign-from-json-workflow: - uses: Keyfactor/actions/.github/workflows/assign-env-from-json.yml@v2 + uses: Keyfactor/actions/.github/workflows/assign-env-from-json.yml@release-2.1 call-get-primary-language: outputs: From e7efc4cbe99e9a48a9e8afa9d28a1fe02fe93323 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Fri, 3 Nov 2023 22:32:50 -0700 Subject: [PATCH 38/95] fix is-release condition --- .github/workflows/go-build-and-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index 3af6711..5db6817 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -21,7 +21,7 @@ jobs: cache: true - name: get-is-release run: | - if [[ "${{ github.event_name == 'pull_request' }}" ]]; then + if [[ "${{ github.event_name }}" == "pull_request" ]]; then echo "GO_ARGS=--snapshot" | tee -a "$GITHUB_ENV" else echo "GO_ARGS=--snapshot --skip-publish" | tee -a "$GITHUB_ENV" From 7071bdd0ee804fd708a59f70b83577080c89a5af Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Sat, 4 Nov 2023 01:03:44 -0700 Subject: [PATCH 39/95] add GPG and workdir properties --- .github/workflows/go-build-and-release.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index 5db6817..12377c4 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -22,15 +22,23 @@ jobs: - name: get-is-release run: | if [[ "${{ github.event_name }}" == "pull_request" ]]; then - echo "GO_ARGS=--snapshot" | tee -a "$GITHUB_ENV" + echo "GO_ARGS=build --snapshot" | tee -a "$GITHUB_ENV" else - echo "GO_ARGS=--snapshot --skip-publish" | tee -a "$GITHUB_ENV" + echo "GO_ARGS=build --snapshot --skip-publish" | tee -a "$GITHUB_ENV" fi + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@v6 + id: import_gpg + with: + gpg_private_key: ${{ secrets.KF_GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.KF_GPG_PASSPHRASE }} - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5 with: args: ${{ env.GO_ARGS }} env: # GitHub sets the GITHUB_TOKEN secret automatically. - GITHUB_TOKEN: ${{ secrets.token }} - PAT_TOKEN: ${{ secrets.token }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PAT_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} + GPG_TTY: $(tty) From 672cb573b993451af0a9814e12071cdd890b8bd7 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Sat, 4 Nov 2023 01:18:30 -0700 Subject: [PATCH 40/95] add post-release workflow, delete prereleases --- .github/workflows/kf-post-release.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/kf-post-release.yml diff --git a/.github/workflows/kf-post-release.yml b/.github/workflows/kf-post-release.yml new file mode 100644 index 0000000..b4ec379 --- /dev/null +++ b/.github/workflows/kf-post-release.yml @@ -0,0 +1,16 @@ +name: Post release tasks +on: + workflow_call: + secrets: + token: + description: token + required: true + +jobs: + clean-releases: + runs-on: ubuntu-latest + steps: + - name: Remove prereleases + uses: keyfacor/action-delete-prereleases@v1.0 + with: + token: ${{ secrets.V2BUILDTOKEN }} From 156681fcb4b110b1693b82d160a07bda48c6fa67 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Sat, 4 Nov 2023 01:21:01 -0700 Subject: [PATCH 41/95] fix typo --- .github/workflows/kf-post-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kf-post-release.yml b/.github/workflows/kf-post-release.yml index b4ec379..f7296fe 100644 --- a/.github/workflows/kf-post-release.yml +++ b/.github/workflows/kf-post-release.yml @@ -11,6 +11,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Remove prereleases - uses: keyfacor/action-delete-prereleases@v1.0 + uses: Keyfactor/action-delete-prereleases@v1.0 with: token: ${{ secrets.V2BUILDTOKEN }} From 8a42f5946c8b9965ec843936546ec92f72feddaf Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Sat, 4 Nov 2023 01:22:12 -0700 Subject: [PATCH 42/95] use repo-token --- .github/workflows/kf-post-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kf-post-release.yml b/.github/workflows/kf-post-release.yml index f7296fe..912070d 100644 --- a/.github/workflows/kf-post-release.yml +++ b/.github/workflows/kf-post-release.yml @@ -13,4 +13,4 @@ jobs: - name: Remove prereleases uses: Keyfactor/action-delete-prereleases@v1.0 with: - token: ${{ secrets.V2BUILDTOKEN }} + repo-token: ${{ secrets.V2BUILDTOKEN }} From a6bad94f56f7c264565a0ca41b52c0c00ec9925a Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Sat, 4 Nov 2023 01:51:42 -0700 Subject: [PATCH 43/95] pass version to goreleaser or 0.0.0 for non-release builds --- .github/workflows/go-build-and-release.yml | 11 ++++++++++- .github/workflows/starter.yml | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index 12377c4..999a45e 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -2,13 +2,19 @@ name: Go build placeholder on: workflow_call: + inputs: + release_version: + description: Condition based on release branch build + required: false + type: string + secrets: token: description: 'Secret token from caller workflow to access private packages' required: true jobs: - call-go-prerelease-workflow: + run-goreleaser: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -23,8 +29,10 @@ jobs: run: | if [[ "${{ github.event_name }}" == "pull_request" ]]; then echo "GO_ARGS=build --snapshot" | tee -a "$GITHUB_ENV" + echo "VERSION=${{ inputs.release_version }}" | tee -a "$GITHUB_ENV" | tee -a "$GITHUB_STEP_SUMMARY" else echo "GO_ARGS=build --snapshot --skip-publish" | tee -a "$GITHUB_ENV" + echo "VERSION=0.0.0" | tee -a "$GITHUB_ENV" | tee -a "$GITHUB_STEP_SUMMARY" fi - name: Import GPG key uses: crazy-max/ghaction-import-gpg@v6 @@ -42,3 +50,4 @@ jobs: PAT_TOKEN: ${{ secrets.GITHUB_TOKEN }} GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} GPG_TTY: $(tty) + Version: ${{ env.VERSION }} diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index f21148e..bf39868 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -51,6 +51,8 @@ jobs: needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow] if: needs.call-get-primary-language.outputs.primary_language == 'Go' uses: keyfactor/actions/.github/workflows/go-build-and-release.yml@release-2.1 + with: + release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} secrets: token: ${{ secrets.token }} From 72deb547204be5d532a684a979f466bf97fbdfe4 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Sat, 4 Nov 2023 01:57:56 -0700 Subject: [PATCH 44/95] pass gpg info correctly --- .github/workflows/go-build-and-release.yml | 4 ++-- .github/workflows/starter.yml | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index 999a45e..52faa89 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -38,8 +38,8 @@ jobs: uses: crazy-max/ghaction-import-gpg@v6 id: import_gpg with: - gpg_private_key: ${{ secrets.KF_GPG_PRIVATE_KEY }} - passphrase: ${{ secrets.KF_GPG_PASSPHRASE }} + gpg_private_key: ${{ secrets.gpg_key }} + passphrase: ${{ secrets.gpg_pass }} - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5 with: diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index bf39868..fa3acf0 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -55,6 +55,8 @@ jobs: release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} secrets: token: ${{ secrets.token }} + gpg_key: ${{ secrets.KF_GPG_PRIVATE_KEY }} + gpg_pass: ${{ secrets.KF_GPG_PASSPHRASE }} call-generate-readme-workflow: if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' From 7e43bca4d10c878e0e243e00dbbedaa7c8d6dfa6 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Sat, 4 Nov 2023 02:01:02 -0700 Subject: [PATCH 45/95] add missing gpg inputs --- .github/workflows/go-build-and-release.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index 52faa89..fe7a8c0 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -12,6 +12,12 @@ on: token: description: 'Secret token from caller workflow to access private packages' required: true + gpg_key: + description: 'GPG Private Key' + required: true + gpg_pass: + description: 'GPG Passphrase' + required: true jobs: run-goreleaser: From 9d3d9ff3e353dc20e2ce1f02a473cf1a242c125c Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Sat, 4 Nov 2023 02:04:08 -0700 Subject: [PATCH 46/95] test --- .github/workflows/starter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index fa3acf0..a8c868e 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -56,7 +56,7 @@ jobs: secrets: token: ${{ secrets.token }} gpg_key: ${{ secrets.KF_GPG_PRIVATE_KEY }} - gpg_pass: ${{ secrets.KF_GPG_PASSPHRASE }} +# gpg_pass: ${{ secrets.KF_GPG_PASSPHRASE }} call-generate-readme-workflow: if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' From 2ac1cd995a7b8d49bc37fb03bfb3018c51f70183 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Sat, 4 Nov 2023 02:07:48 -0700 Subject: [PATCH 47/95] add back gpg --- .github/workflows/go-build-and-release.yml | 4 ++-- .github/workflows/starter.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index fe7a8c0..032c2d7 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -44,8 +44,8 @@ jobs: uses: crazy-max/ghaction-import-gpg@v6 id: import_gpg with: - gpg_private_key: ${{ secrets.gpg_key }} - passphrase: ${{ secrets.gpg_pass }} + gpg_private_key: ${{ secrets.gpg_key }}foo + passphrase: ${{ secrets.gpg_pass }}bar - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5 with: diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index a8c868e..fa3acf0 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -56,7 +56,7 @@ jobs: secrets: token: ${{ secrets.token }} gpg_key: ${{ secrets.KF_GPG_PRIVATE_KEY }} -# gpg_pass: ${{ secrets.KF_GPG_PASSPHRASE }} + gpg_pass: ${{ secrets.KF_GPG_PASSPHRASE }} call-generate-readme-workflow: if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' From e27a3234273e52aa91bd19f50701ad9d5281a8df Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Sat, 4 Nov 2023 02:12:36 -0700 Subject: [PATCH 48/95] passing secrets through the starter --- .github/workflows/starter.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index fa3acf0..07e92e0 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -8,6 +8,13 @@ on: APPROVE_README_PUSH: description: 'Token to add-and-commit generated readme' required: true + gpg_key: + description: 'GPG Private Key' + required: true + gpg_pass: + description: 'GPG Passphrase' + required: true + jobs: call-assign-from-json-workflow: From 3d8bbf8509a18a41dc1349859eecd6fa5db3971c Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Sat, 4 Nov 2023 02:26:21 -0700 Subject: [PATCH 49/95] remove assertion, update gpg definitions --- .github/workflows/go-build-and-release.yml | 4 ++-- .github/workflows/starter.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index 032c2d7..fe7a8c0 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -44,8 +44,8 @@ jobs: uses: crazy-max/ghaction-import-gpg@v6 id: import_gpg with: - gpg_private_key: ${{ secrets.gpg_key }}foo - passphrase: ${{ secrets.gpg_pass }}bar + gpg_private_key: ${{ secrets.gpg_key }} + passphrase: ${{ secrets.gpg_pass }} - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5 with: diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index 07e92e0..62de45b 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -62,8 +62,8 @@ jobs: release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} secrets: token: ${{ secrets.token }} - gpg_key: ${{ secrets.KF_GPG_PRIVATE_KEY }} - gpg_pass: ${{ secrets.KF_GPG_PASSPHRASE }} + gpg_key: ${{ secrets.gpg_key }} + gpg_pass: ${{ secrets.gpg_pass }} call-generate-readme-workflow: if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' From d30f77a15d663234a10a34a7664ae66c78e24a2c Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Sat, 4 Nov 2023 02:31:59 -0700 Subject: [PATCH 50/95] fix goreleaser params --- .github/workflows/go-build-and-release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index fe7a8c0..cac8865 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -34,10 +34,10 @@ jobs: - name: get-is-release run: | if [[ "${{ github.event_name }}" == "pull_request" ]]; then - echo "GO_ARGS=build --snapshot" | tee -a "$GITHUB_ENV" + echo "GO_ARGS=release" | tee -a "$GITHUB_ENV" echo "VERSION=${{ inputs.release_version }}" | tee -a "$GITHUB_ENV" | tee -a "$GITHUB_STEP_SUMMARY" else - echo "GO_ARGS=build --snapshot --skip-publish" | tee -a "$GITHUB_ENV" + echo "GO_ARGS=build" | tee -a "$GITHUB_ENV" echo "VERSION=0.0.0" | tee -a "$GITHUB_ENV" | tee -a "$GITHUB_STEP_SUMMARY" fi - name: Import GPG key @@ -49,7 +49,7 @@ jobs: - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5 with: - args: ${{ env.GO_ARGS }} + args: ${{ env.GO_ARGS }} --snapshot env: # GitHub sets the GITHUB_TOKEN secret automatically. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 5b97e4e2cc63cc85288e42016c9e0a38e633dd6c Mon Sep 17 00:00:00 2001 From: Mikey Henderson Date: Sun, 5 Nov 2023 00:18:22 -0700 Subject: [PATCH 51/95] only release-*.* branch --- .github/workflows/go-build-and-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index cac8865..25c8ffb 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -33,7 +33,7 @@ jobs: cache: true - name: get-is-release run: | - if [[ "${{ github.event_name }}" == "pull_request" ]]; then + if [[ ("${{ github.event_name }}" == "pull_request") && "${{ inputs.release_version }}" != "" ]]; then echo "GO_ARGS=release" | tee -a "$GITHUB_ENV" echo "VERSION=${{ inputs.release_version }}" | tee -a "$GITHUB_ENV" | tee -a "$GITHUB_STEP_SUMMARY" else From 375bca4e2d7681ba1983a1805481b0446bfdf90b Mon Sep 17 00:00:00 2001 From: Mikey Henderson Date: Mon, 6 Nov 2023 09:23:53 -0800 Subject: [PATCH 52/95] Update v2 readme --- README.md | 76 +++++++++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 4676d98..8d97811 100644 --- a/README.md +++ b/README.md @@ -1,47 +1,45 @@ -### The following workflows are available through the actions repository - -### Note: if reading a json file for properties, you must first checkout the repo using actions/checkout@v3 first - -## assign-env-from-json.yml -* Create a variable for use in a workflow from a property set in a json file. This utilizes the action fiddlermikey/assign-from-json -``` - - name: Assign variable - uses: fiddlermikey/assign-from-json@v1.0 - id: read-name - with: - input-file: 'src/integration-manifest.json' - input-property: 'name' - -``` -The output property will be available as: -``` -steps.read-name.outputs.output-value -``` ---- -## update-store-types.yml +### Actions v2 Workflows + +These workflows are designed to work with the latest keyfactor-bootstrap-workflow "Keyfactor Bootstrap Workflow" +This workflow passes 2 secrets to the starter.yml workflow. If you are testing or developing from a forked copy of this repository, but sure to set the secrets: + +* V2BUILDTOKEN: This is required for all builds and must have full repo scope, and package:read permissions +* APPROVE_README_PUSH: full repo scope + +The following are used for go lang builds and are set at the organization level. If you test or develop for a fork, you will need to add secrets to our local forked repository with the following definitions: +* gpg_key: This is a private gpg key stored as a secret +* gpg_pass: This is th private gpg passphrase stored as a secret + +### The Bootstrap workflow for v2 Actions perform the following steps: + +* Checkout integration repository +* Get values from integration-manifest.json [assign-env-from-json] +* Discover primary programming language from the repository [action-get-primary-language] +* Determine event_name: create, push, pull_request, workflow_dispatch [github-release] +* Run the workflows and conditionalized steps to produce a build. If conditions match, release artifacts are delivered [dotnet-build-and-release | go-build-and-release] + +### On Create: +* Configure repository settings - This will use the properties from the json to update topic and description, and will set the teams permissions on the repo accordingly. If the ref created is a branch that matches "release-*.*", branch protection is added [kf-configure-repo] + +### On push or workflow_dispatch: +* Just run the build on the branch with the commit without producing release artifacts +* * C#: run the dotnet-build-and-release.yml workflow +* * Go builds: run the go-build-and-release.yml workflow (still in progress) +* All languages: Generate a readme and (conditionally) a catalog entry [generate-readme, update-catalog] + +### On pull_request[opened, closed, synchronize, edited, reopened]: +[dotnet-build-and-release | go-build-and-release] +* If the pr destination is a release-*.* branch, set flags to produce release artifacts +* If the pr is determined to be open or merged but not closed (synchronize), a prerelease artifact will be uploaded +* If the pr is determined to be merged and closed, a final release is built -This workflow contains two functions. One is to update the store_types.json in kfutil, and the second part creates the markdown stub to be included in the repository readme file. -Add this through your repo action tab. Select New Workflow and then select the 'Keyfactor Merge Cert Store Types' reusable workflow. No additional configuration is necessary. Simple select the workflow and run it manually. ---- -## Configuration workflows -The following workflows will assist in creating the default repository settings for topic, team access, and description. -* kf-update-description.yml -* kf-update-teams.yml -* kf-update-topics.yml ### Todo: -* Add Branch protection and autolinking -* Create workflow template -* Add configuration options to json properties -* Create reusable workflow in .github repo ---- -## The original build workflows +* Add autolinking +* Remove default admin user when applying branch protection -* update-catalog.yml -* generate-readme.yml -* dotnet-build-and-release.yml -* github-release.yml +--- From 1bf68cee74a2645bcbea5ae758d99ffae5d3ffa3 Mon Sep 17 00:00:00 2001 From: Mikey Henderson Date: Mon, 6 Nov 2023 09:44:20 -0800 Subject: [PATCH 53/95] Add formatting --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 8d97811..c68b72a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ### Actions v2 Workflows -These workflows are designed to work with the latest keyfactor-bootstrap-workflow "Keyfactor Bootstrap Workflow" -This workflow passes 2 secrets to the starter.yml workflow. If you are testing or developing from a forked copy of this repository, but sure to set the secrets: +These workflows are designed to work with the latest [keyfactor-bootstrap-workflow.yml "Keyfactor Bootstrap Workflow"](https://github.com/Keyfactor/.github/blob/main/workflow-templates/keyfactor-bootstrap-workflow.yml) +This *bootstrap workflow* passes 2 secrets to the starter.yml workflow. If you are testing or developing from a forked copy of this repository, but sure to set the secrets: * V2BUILDTOKEN: This is required for all builds and must have full repo scope, and package:read permissions * APPROVE_README_PUSH: full repo scope @@ -13,22 +13,22 @@ The following are used for go lang builds and are set at the organization level. ### The Bootstrap workflow for v2 Actions perform the following steps: * Checkout integration repository -* Get values from integration-manifest.json [assign-env-from-json] -* Discover primary programming language from the repository [action-get-primary-language] -* Determine event_name: create, push, pull_request, workflow_dispatch [github-release] -* Run the workflows and conditionalized steps to produce a build. If conditions match, release artifacts are delivered [dotnet-build-and-release | go-build-and-release] +* Get values from integration-manifest.json [***assign-env-from-json***] +* Discover primary programming language from the repository [***action-get-primary-language***] +* Determine event_name: create, push, pull_request, workflow_dispatch [***github-release]*** +* Run the workflows and conditionalized steps to produce a build. If conditions match, release artifacts are delivered [***dotnet-build-and-release | go-build-and-release***] ### On Create: -* Configure repository settings - This will use the properties from the json to update topic and description, and will set the teams permissions on the repo accordingly. If the ref created is a branch that matches "release-*.*", branch protection is added [kf-configure-repo] +* Configure repository settings - This will use the properties from the json to update topic and description, and will set the teams permissions on the repo accordingly. If the ref created is a branch that matches "release-*.*", branch protection is added [***kf-configure-repo***] ### On push or workflow_dispatch: * Just run the build on the branch with the commit without producing release artifacts * * C#: run the dotnet-build-and-release.yml workflow * * Go builds: run the go-build-and-release.yml workflow (still in progress) -* All languages: Generate a readme and (conditionally) a catalog entry [generate-readme, update-catalog] +* All languages: Generate a readme and (conditionally) a catalog entry [***generate-readme, update-catalog***] ### On pull_request[opened, closed, synchronize, edited, reopened]: -[dotnet-build-and-release | go-build-and-release] +[***dotnet-build-and-release | go-build-and-release***] * If the pr destination is a release-*.* branch, set flags to produce release artifacts * If the pr is determined to be open or merged but not closed (synchronize), a prerelease artifact will be uploaded * If the pr is determined to be merged and closed, a final release is built From 4505408a7114a5673ee1c10ad781d38cd3c7aa2d Mon Sep 17 00:00:00 2001 From: Mikey Henderson Date: Mon, 6 Nov 2023 09:53:33 -0800 Subject: [PATCH 54/95] add formatting --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c68b72a..2fe6f02 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -### Actions v2 Workflows +### 👨🏿‍🚀 Actions v2 Workflows These workflows are designed to work with the latest [keyfactor-bootstrap-workflow.yml "Keyfactor Bootstrap Workflow"](https://github.com/Keyfactor/.github/blob/main/workflow-templates/keyfactor-bootstrap-workflow.yml) This *bootstrap workflow* passes 2 secrets to the starter.yml workflow. If you are testing or developing from a forked copy of this repository, but sure to set the secrets: @@ -10,7 +10,7 @@ The following are used for go lang builds and are set at the organization level. * gpg_key: This is a private gpg key stored as a secret * gpg_pass: This is th private gpg passphrase stored as a secret -### The Bootstrap workflow for v2 Actions perform the following steps: +### 🚀The Bootstrap workflow for v2 Actions perform the following steps: * Checkout integration repository * Get values from integration-manifest.json [***assign-env-from-json***] @@ -38,7 +38,7 @@ The following are used for go lang builds and are set at the organization level. -### Todo: +### 🗒️Todo: * Add autolinking * Remove default admin user when applying branch protection From e85799e4a884e78464bca150f79e3df83c646793 Mon Sep 17 00:00:00 2001 From: Mikey Henderson Date: Mon, 6 Nov 2023 09:54:17 -0800 Subject: [PATCH 55/95] minor change --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2fe6f02..3ac707f 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ The following are used for go lang builds and are set at the organization level. -### 🗒️Todo: +### 📝Todo: * Add autolinking * Remove default admin user when applying branch protection From 8fb4d276e7d9aa0fd66cc32a862f789f16078469 Mon Sep 17 00:00:00 2001 From: Mikey Henderson Date: Mon, 6 Nov 2023 10:49:42 -0800 Subject: [PATCH 56/95] escape * --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3ac707f..d7ebd77 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ The following are used for go lang builds and are set at the organization level. * Run the workflows and conditionalized steps to produce a build. If conditions match, release artifacts are delivered [***dotnet-build-and-release | go-build-and-release***] ### On Create: -* Configure repository settings - This will use the properties from the json to update topic and description, and will set the teams permissions on the repo accordingly. If the ref created is a branch that matches "release-*.*", branch protection is added [***kf-configure-repo***] +* Configure repository settings - This will use the properties from the json to update topic and description, and will set the teams permissions on the repo accordingly. If the ref created is a branch that matches "release-\*.\*", branch protection is added [***kf-configure-repo***] ### On push or workflow_dispatch: * Just run the build on the branch with the commit without producing release artifacts From 43e4ba0839f28cf59230d9b52fe3006e495a6c73 Mon Sep 17 00:00:00 2001 From: Mikey Henderson Date: Mon, 6 Nov 2023 11:36:31 -0800 Subject: [PATCH 57/95] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d7ebd77..2207eed 100644 --- a/README.md +++ b/README.md @@ -41,5 +41,6 @@ The following are used for go lang builds and are set at the organization level. ### 📝Todo: * Add autolinking * Remove default admin user when applying branch protection +* Add overrides for detected language, readme build(?), etc. into json manifest --- From 7449b9b873dadeba6e6ef99c4034388db0155cfa Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Tue, 7 Nov 2023 10:39:11 -0800 Subject: [PATCH 58/95] add autolink reference configuration task --- .github/workflows/kf-configure-repo.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/kf-configure-repo.yml b/.github/workflows/kf-configure-repo.yml index ef6ae24..6719021 100644 --- a/.github/workflows/kf-configure-repo.yml +++ b/.github/workflows/kf-configure-repo.yml @@ -57,3 +57,13 @@ jobs: with: repo-token: ${{ secrets.token}} protect-branch: ${{ github.event.ref}} + call-add-autolink: + runs-on: ubuntu-latest + steps: + - name: Add autolink + uses: fiddlermikey/action-add-autolink@v1.0 + with: + token: ${{ secrets.V2BUILDTOKEN}} + keyPrefix: 'ab#' + url: 'https://dev.azure.com/Keyfactor/Integration/_workitems/edit/' + From 4bc678cc5a8dac5f69f82bba17a25880e702c375 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Tue, 7 Nov 2023 10:41:35 -0800 Subject: [PATCH 59/95] add autolinking to readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2207eed..49bfa2e 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ The following are used for go lang builds and are set at the organization level. * Run the workflows and conditionalized steps to produce a build. If conditions match, release artifacts are delivered [***dotnet-build-and-release | go-build-and-release***] ### On Create: -* Configure repository settings - This will use the properties from the json to update topic and description, and will set the teams permissions on the repo accordingly. If the ref created is a branch that matches "release-\*.\*", branch protection is added [***kf-configure-repo***] +* Configure repository settings - This will use the properties from the json to update topic and description, and will set the teams permissions on the repo accordingly. If the ref created is a branch that matches "release-\*.\*", branch protection is added, autlink reference set ab# to devops [***kf-configure-repo***] ### On push or workflow_dispatch: * Just run the build on the branch with the commit without producing release artifacts From 3b28247e45853e19051115657ec6679accfdc48f Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Tue, 7 Nov 2023 12:22:13 -0800 Subject: [PATCH 60/95] Update readme and workflow comments --- .github/workflows/kf-configure-repo.yml | 3 ++- README.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/kf-configure-repo.yml b/.github/workflows/kf-configure-repo.yml index 6719021..701053c 100644 --- a/.github/workflows/kf-configure-repo.yml +++ b/.github/workflows/kf-configure-repo.yml @@ -5,7 +5,8 @@ name: Configure Repository Release Branch Settings # - action-assign-topics # - action-gh-teams-update # - action-set-branch-protection -# - action-set-repo-license +# - action-add-autolink +# - TODO: action-set-repo-license ############################################################################################# on: workflow_call: diff --git a/README.md b/README.md index 49bfa2e..6ee09ea 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,8 @@ The following are used for go lang builds and are set at the organization level. ### 📝Todo: -* Add autolinking * Remove default admin user when applying branch protection * Add overrides for detected language, readme build(?), etc. into json manifest +* Set repo license --- From cf4477e5fefaea2e9f09e0643ff38529e509d4ad Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Mon, 13 Nov 2023 11:45:16 -0800 Subject: [PATCH 61/95] swap to GITHUB_TOKEN for detecting primary language --- .github/workflows/starter.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index 62de45b..783a23f 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -29,12 +29,12 @@ jobs: - name: Checkout uses: actions/checkout@v3 with: - token: ${{ secrets.token }} + token: ${{ secrets.GITHUB_TOKEN }} - name: Read primary language id: read uses: fiddlermikey/action-get-primary-language@v1.0 with: - token: ${{ secrets.token }} + token: ${{ secrets.GITHUB_TOKEN }} - name: Display type id: display run: | From 2e044be51a4fceeb7bd455ac382d876880dbab75 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Mon, 13 Nov 2023 14:04:24 -0800 Subject: [PATCH 62/95] use GITHUB_TOKEN when calling reusable workflows for main build for nuget restore error --- .github/workflows/starter.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index 783a23f..587147e 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -52,7 +52,7 @@ jobs: release_url: ${{ needs.call-create-github-release-workflow.outputs.release_url }} release_dir: ${{ needs.call-assign-from-json-workflow.outputs.release_dir }} secrets: - token: ${{ secrets.token }} + token: ${{ secrets.GITHUB_TOKEN }} call-go-build-and-release-workflow: needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow] @@ -61,7 +61,7 @@ jobs: with: release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} secrets: - token: ${{ secrets.token }} + token: ${{ secrets.GITHUB_TOKEN }} gpg_key: ${{ secrets.gpg_key }} gpg_pass: ${{ secrets.gpg_pass }} @@ -81,7 +81,7 @@ jobs: if: github.event_name == 'create' && startsWith(github.ref, 'refs/heads/release-') uses: Keyfactor/actions/.github/workflows/kf-configure-repo.yml@v2 secrets: - token: ${{ secrets.token }} + token: ${{ secrets.GITHUB_TOKEN }} #call-post-release-cleanup-workflow: # needs: [call-dotnet-build-and-release-workflow, call-assign-from-json-workflow, call-create-github-release-workflow] From 035f5f03edd14350b27e3178098750fb1007f52b Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Mon, 13 Nov 2023 16:13:29 -0800 Subject: [PATCH 63/95] use old PAT definition --- .github/workflows/starter.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index 587147e..002fbe3 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -2,7 +2,7 @@ name: Bootstrap Starter Workflow on: workflow_call: secrets: - token: + CI_TOKEN: description: 'GitHub token' required: true APPROVE_README_PUSH: @@ -52,7 +52,7 @@ jobs: release_url: ${{ needs.call-create-github-release-workflow.outputs.release_url }} release_dir: ${{ needs.call-assign-from-json-workflow.outputs.release_dir }} secrets: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.PRIVATE_PACKAGE_ACCESS }} call-go-build-and-release-workflow: needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow] @@ -81,7 +81,7 @@ jobs: if: github.event_name == 'create' && startsWith(github.ref, 'refs/heads/release-') uses: Keyfactor/actions/.github/workflows/kf-configure-repo.yml@v2 secrets: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.token }} #call-post-release-cleanup-workflow: # needs: [call-dotnet-build-and-release-workflow, call-assign-from-json-workflow, call-create-github-release-workflow] From 2d4710f5a664c5b9bead14e0623c2d4d43705304 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Tue, 14 Nov 2023 09:52:10 -0800 Subject: [PATCH 64/95] use CI_TOKEN --- .github/workflows/starter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index 002fbe3..67087d0 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -52,7 +52,7 @@ jobs: release_url: ${{ needs.call-create-github-release-workflow.outputs.release_url }} release_dir: ${{ needs.call-assign-from-json-workflow.outputs.release_dir }} secrets: - token: ${{ secrets.PRIVATE_PACKAGE_ACCESS }} + token: ${{ secrets.CI_TOKEN }} call-go-build-and-release-workflow: needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow] From 3a4c1d8a08c4ce46efd6f9452a473599aa1fbe0c Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Tue, 14 Nov 2023 16:52:09 -0800 Subject: [PATCH 65/95] back to token --- .github/workflows/starter.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index 67087d0..64d5a0f 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -2,7 +2,7 @@ name: Bootstrap Starter Workflow on: workflow_call: secrets: - CI_TOKEN: + token: description: 'GitHub token' required: true APPROVE_README_PUSH: @@ -18,7 +18,7 @@ on: jobs: call-assign-from-json-workflow: - uses: Keyfactor/actions/.github/workflows/assign-env-from-json.yml@release-2.1 + uses: Keyfactor/actions/.github/workflows/assign-env-from-json.yml@v2 call-get-primary-language: outputs: @@ -52,12 +52,12 @@ jobs: release_url: ${{ needs.call-create-github-release-workflow.outputs.release_url }} release_dir: ${{ needs.call-assign-from-json-workflow.outputs.release_dir }} secrets: - token: ${{ secrets.CI_TOKEN }} + token: ${{ secrets.token }} call-go-build-and-release-workflow: needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow] if: needs.call-get-primary-language.outputs.primary_language == 'Go' - uses: keyfactor/actions/.github/workflows/go-build-and-release.yml@release-2.1 + uses: keyfactor/actions/.github/workflows/go-build-and-release.yml@v2 with: release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} secrets: @@ -67,13 +67,13 @@ jobs: call-generate-readme-workflow: if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' - uses: Keyfactor/actions/.github/workflows/generate-readme.yml@main + uses: Keyfactor/actions/.github/workflows/generate-readme.yml@v2 secrets: token: ${{ secrets.APPROVE_README_PUSH }} call-update-catalog-workflow: if: inputs.update_catalog == 'True' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') - uses: Keyfactor/actions/.github/workflows/update-catalog.yml@main + uses: Keyfactor/actions/.github/workflows/update-catalog.yml@v2 secrets: token: ${{ secrets.SDK_SYNC_PAT }} From d7bcbd5b535c3ffd05cccc48d7c4a8875050aacb Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Wed, 15 Nov 2023 16:17:44 -0800 Subject: [PATCH 66/95] update args passed during go builds --- .github/workflows/go-build-and-release.yml | 6 +++--- .github/workflows/starter.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index 25c8ffb..84041a6 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -34,10 +34,10 @@ jobs: - name: get-is-release run: | if [[ ("${{ github.event_name }}" == "pull_request") && "${{ inputs.release_version }}" != "" ]]; then - echo "GO_ARGS=release" | tee -a "$GITHUB_ENV" + echo "GO_ARGS=release --clean" | tee -a "$GITHUB_ENV" echo "VERSION=${{ inputs.release_version }}" | tee -a "$GITHUB_ENV" | tee -a "$GITHUB_STEP_SUMMARY" else - echo "GO_ARGS=build" | tee -a "$GITHUB_ENV" + echo "GO_ARGS=build --snapshot" | tee -a "$GITHUB_ENV" echo "VERSION=0.0.0" | tee -a "$GITHUB_ENV" | tee -a "$GITHUB_STEP_SUMMARY" fi - name: Import GPG key @@ -49,7 +49,7 @@ jobs: - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5 with: - args: ${{ env.GO_ARGS }} --snapshot + args: ${{ env.GO_ARGS }} env: # GitHub sets the GITHUB_TOKEN secret automatically. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index 64d5a0f..96b33e3 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -57,7 +57,7 @@ jobs: call-go-build-and-release-workflow: needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow] if: needs.call-get-primary-language.outputs.primary_language == 'Go' - uses: keyfactor/actions/.github/workflows/go-build-and-release.yml@v2 + uses: keyfactor/actions/.github/workflows/go-build-and-release.yml@release-2.1 with: release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} secrets: From 556d2f363301ba0a65182e23bdecb9628a382f96 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Wed, 15 Nov 2023 16:35:41 -0800 Subject: [PATCH 67/95] match ^$prbasetag --- .github/workflows/github-release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index fe471f5..cda3a07 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -68,12 +68,12 @@ jobs: git fetch --tags if [[ -n `git tag` ]]; then echo "Setting vars" - allBranchTags=`git tag --sort=-v:refname | grep "$prbasetag" || echo ""` + allBranchTags=`git tag --sort=-v:refname | grep "^$prbasetag" || echo ""` allRepoTags=`git tag --sort=-v:refname` - branchTagBase=`git tag --sort=-v:refname | grep "$prbasetag" | grep -o '^[0-9.]*' | head -n 1 || echo ""` + branchTagBase=`git tag --sort=-v:refname | grep "^$prbasetag" | grep -o '^[0-9.]*' | head -n 1 || echo ""` latestTagBase=`git tag --sort=-v:refname | grep -o '^[0-9.]*' | head -n 1` - latestBranchTag=`git tag --sort=-v:refname | grep "$prbasetag" | grep "^$branchTagBase" | head -n 1 || echo ""` - latestReleasedTag=`git tag --sort=-v:refname | grep "$prbasetag" | grep "^$branchTagBase$" | head -n 1 || echo ""` + latestBranchTag=`git tag --sort=-v:refname | grep "^$prbasetag" | grep "^$branchTagBase" | head -n 1 || echo ""` + latestReleasedTag=`git tag --sort=-v:refname | grep "^$prbasetag" | grep "^$branchTagBase$" | head -n 1 || echo ""` # If the *TagBase values are not found in the list of tags, it means no final release was produced, and the latest*Tag vars will be empty if [[ -z "$latestReleasedTag" ]]; then From c3e2524e4634813096e9dc1d7879c72332503ea8 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Wed, 15 Nov 2023 16:43:17 -0800 Subject: [PATCH 68/95] use the release-2.1 github-release workflow --- .github/workflows/starter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index 96b33e3..b83e659 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -41,7 +41,7 @@ jobs: echo "primary_language=${{ steps.read.outputs.primary_language}}" | tee -a "$GITHUB_OUTPUT" | tee -a $GITHUB_STEP_SUMMARY call-create-github-release-workflow: - uses: Keyfactor/actions/.github/workflows/github-release.yml@v2 + uses: Keyfactor/actions/.github/workflows/github-release.yml@release-2.1 call-dotnet-build-and-release-workflow: needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow] From 39daf8697b3ea8260760777d74921342075e879a Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Wed, 15 Nov 2023 17:11:16 -0800 Subject: [PATCH 69/95] use v2 tags for all workflows --- .github/workflows/starter.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index b83e659..64d5a0f 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -41,7 +41,7 @@ jobs: echo "primary_language=${{ steps.read.outputs.primary_language}}" | tee -a "$GITHUB_OUTPUT" | tee -a $GITHUB_STEP_SUMMARY call-create-github-release-workflow: - uses: Keyfactor/actions/.github/workflows/github-release.yml@release-2.1 + uses: Keyfactor/actions/.github/workflows/github-release.yml@v2 call-dotnet-build-and-release-workflow: needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow] @@ -57,7 +57,7 @@ jobs: call-go-build-and-release-workflow: needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow] if: needs.call-get-primary-language.outputs.primary_language == 'Go' - uses: keyfactor/actions/.github/workflows/go-build-and-release.yml@release-2.1 + uses: keyfactor/actions/.github/workflows/go-build-and-release.yml@v2 with: release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} secrets: From 2a84cb8984427b532f37f266ab16caca3d9068f8 Mon Sep 17 00:00:00 2001 From: Michael Henderson Date: Fri, 17 Nov 2023 09:25:36 -0800 Subject: [PATCH 70/95] remove autolink for troubleshooting --- .github/workflows/kf-configure-repo.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/kf-configure-repo.yml b/.github/workflows/kf-configure-repo.yml index 701053c..fb45803 100644 --- a/.github/workflows/kf-configure-repo.yml +++ b/.github/workflows/kf-configure-repo.yml @@ -58,13 +58,13 @@ jobs: with: repo-token: ${{ secrets.token}} protect-branch: ${{ github.event.ref}} - call-add-autolink: - runs-on: ubuntu-latest - steps: - - name: Add autolink - uses: fiddlermikey/action-add-autolink@v1.0 - with: - token: ${{ secrets.V2BUILDTOKEN}} - keyPrefix: 'ab#' - url: 'https://dev.azure.com/Keyfactor/Integration/_workitems/edit/' + #call-add-autolink: + # runs-on: ubuntu-latest + # steps: + # - name: Add autolink + # uses: fiddlermikey/action-add-autolink@v1.0 + # with: + # token: ${{ secrets.V2BUILDTOKEN}} + # keyPrefix: 'ab#' + # url: 'https://dev.azure.com/Keyfactor/Integration/_workitems/edit/' From 3f36d2a7ec2e0ea2a86e55c02cfae8c364338a5c Mon Sep 17 00:00:00 2001 From: Mikey Henderson Date: Fri, 17 Nov 2023 11:19:06 -0800 Subject: [PATCH 71/95] Update json reader (#59) * release_dir is only valid for orchestrators, pam, ca-gateway types It specifies the location of the output folder from the build and is not valid for other types at this time --- .github/workflows/assign-env-from-json.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/assign-env-from-json.yml b/.github/workflows/assign-env-from-json.yml index 82b64cc..2e354e5 100644 --- a/.github/workflows/assign-env-from-json.yml +++ b/.github/workflows/assign-env-from-json.yml @@ -76,6 +76,7 @@ jobs: input-property: 'about.orchestrator.UOFramework' - name: Read release_dir property + if: steps.read-type.outputs.output-value == 'orchestrator' || steps.read-type.outputs.output-value == 'ca-gateway' || steps.read-type.outputs.output-value == 'pam' uses: ./tools id: read-release_dir with: From 5d043a12175ef789fadd70fbc8555a1bf4feb1f5 Mon Sep 17 00:00:00 2001 From: Mikey Henderson Date: Thu, 7 Dec 2023 12:10:13 -0800 Subject: [PATCH 72/95] v2.2.0 Updates (#63) * feat(script): Delete release/tag on failed release-* branch build * feat(script): Checking for manifest.json in orchestrator projects [ab@52419] * feat(doc): add keyfactor_platform_version property --- .github/workflows/assign-env-from-json.yml | 8 ++++++++ .../workflows/dotnet-build-and-release.yml | 19 +++++++++++++++++++ .github/workflows/starter.yml | 1 + 3 files changed, 28 insertions(+) diff --git a/.github/workflows/assign-env-from-json.yml b/.github/workflows/assign-env-from-json.yml index 2e354e5..7ebdeca 100644 --- a/.github/workflows/assign-env-from-json.yml +++ b/.github/workflows/assign-env-from-json.yml @@ -75,6 +75,14 @@ jobs: input-file: 'src/integration-manifest.json' input-property: 'about.orchestrator.UOFramework' + - name: Read keyfactor_platform_version property + if: steps.read-type.outputs.output-value == 'orchestrator' || steps.read-type.outputs.output-value == 'pam' + uses: ./tools + id: read-keyfactor_platform_version + with: + input-file: 'src/integration-manifest.json' + input-property: 'about.orchestrator.keyfactor_platform_version' + - name: Read release_dir property if: steps.read-type.outputs.output-value == 'orchestrator' || steps.read-type.outputs.output-value == 'ca-gateway' || steps.read-type.outputs.output-value == 'pam' uses: ./tools diff --git a/.github/workflows/dotnet-build-and-release.yml b/.github/workflows/dotnet-build-and-release.yml index 7157fbb..201ed54 100644 --- a/.github/workflows/dotnet-build-and-release.yml +++ b/.github/workflows/dotnet-build-and-release.yml @@ -15,6 +15,10 @@ on: description: The relative directory inside the repo where the build artifacts to publish for release will be located required: false # leave empty for non-release build type: string + integration_type: + description: The extension integration_type + required: true + type: string secrets: token: description: 'Secret token from caller workflow to access private packages' @@ -83,6 +87,12 @@ jobs: $newVer = "${{ inputs.release_version || '1.0.0' }}".TrimStart('v').Split('-')[0] MSBuild.exe $Env:SOLUTION_PATH -p:RestorePackagesConfig=false -p:Configuration=Release -p:Version=$newVer + - name: Check for manifest + if: success() && env.CREATE_RELEASE == 'True' && inputs.integration_type == 'orchestrator' + run: | + $fileExists = Get-ChildItem -Path ${{ github.workspace }}\${{ inputs.release_dir }} -Recurse -Filter 'manifest.json' | Select-Object -First 1 + if (-not $fileExists) { exit 1 } + - name: Archive Files if: success() && env.CREATE_RELEASE == 'True' run: | @@ -102,3 +112,12 @@ jobs: asset_path: ${{ github.workspace }}\zip\Keyfactor\${{ env.REPO_NAME}}.zip asset_name: ${{ env.REPO_NAME}}_${{ inputs.release_version }}.zip asset_content_type: application/zip + + - name: Delete Failed Release + if: failure() && env.CREATE_RELEASE == 'True' + id: delete-failed-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release delete ${{ inputs.release_version }} --yes --cleanup-tag + diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index 64d5a0f..7a3f61d 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -51,6 +51,7 @@ jobs: release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} release_url: ${{ needs.call-create-github-release-workflow.outputs.release_url }} release_dir: ${{ needs.call-assign-from-json-workflow.outputs.release_dir }} + integration_type: ${{ needs.call-assign-from-json-workflow.outputs.integration_type }} secrets: token: ${{ secrets.token }} From fa57d4bb9911f6dce6a3e7fdc94f8c6a2d06bc78 Mon Sep 17 00:00:00 2001 From: sbailey <1661003+spbsoluble@users.noreply.github.com> Date: Thu, 25 Jan 2024 12:06:58 -0800 Subject: [PATCH 73/95] feat: starter workflow now allows for release version override and language override. --- .github/workflows/starter.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index 7a3f61d..8bb12be 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -1,6 +1,15 @@ name: Bootstrap Starter Workflow on: workflow_call: + inputs: + release_version_override: + description: 'Force a specific release version' + required: false + type: string + primary_language_override: + description: 'Force a specific primary language. Valid values are "C#" and "Go"' + required: false + type: string secrets: token: description: 'GitHub token' @@ -22,7 +31,7 @@ jobs: call-get-primary-language: outputs: - primary_language: ${{ steps.read.outputs.primary_language }} + primary_language: ${{ inputs.primary_language_override || steps.read.outputs.primary_language }} runs-on: ubuntu-latest name: Detect Primary Language steps: @@ -48,7 +57,7 @@ jobs: if: needs.call-get-primary-language.outputs.primary_language == 'C#' uses: keyfactor/actions/.github/workflows/dotnet-build-and-release.yml@v2 with: - release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} + release_version: ${{ inputs.release_version_override || needs.call-create-github-release-workflow.outputs.release_version }} release_url: ${{ needs.call-create-github-release-workflow.outputs.release_url }} release_dir: ${{ needs.call-assign-from-json-workflow.outputs.release_dir }} integration_type: ${{ needs.call-assign-from-json-workflow.outputs.integration_type }} @@ -60,7 +69,7 @@ jobs: if: needs.call-get-primary-language.outputs.primary_language == 'Go' uses: keyfactor/actions/.github/workflows/go-build-and-release.yml@v2 with: - release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} + release_version: ${{ inputs.release_version_override || needs.call-create-github-release-workflow.outputs.release_version }} secrets: token: ${{ secrets.GITHUB_TOKEN }} gpg_key: ${{ secrets.gpg_key }} From 839f7cb00ed29b580ec51a523065c4885e3606a9 Mon Sep 17 00:00:00 2001 From: sbailey <1661003+spbsoluble@users.noreply.github.com> Date: Thu, 25 Jan 2024 12:25:08 -0800 Subject: [PATCH 74/95] feat: starter workflow now allows for release version override and language override. --- .github/workflows/go-build-and-release.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index 84041a6..4fdeae9 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -7,6 +7,10 @@ on: description: Condition based on release branch build required: false type: string + force_release: + description: Force a release build + required: false + type: boolean secrets: token: @@ -33,7 +37,7 @@ jobs: cache: true - name: get-is-release run: | - if [[ ("${{ github.event_name }}" == "pull_request") && "${{ inputs.release_version }}" != "" ]]; then + if ("${{ github.event_name }}" == "pull_request" || "${{ inputs.force_release }}" == "true") && "${{ inputs.release_version }}" != "" ]]; then echo "GO_ARGS=release --clean" | tee -a "$GITHUB_ENV" echo "VERSION=${{ inputs.release_version }}" | tee -a "$GITHUB_ENV" | tee -a "$GITHUB_STEP_SUMMARY" else From 6d3aba05b1432018c9983326ae934dc95155adad Mon Sep 17 00:00:00 2001 From: sbailey <1661003+spbsoluble@users.noreply.github.com> Date: Thu, 25 Jan 2024 12:25:12 -0800 Subject: [PATCH 75/95] feat: starter workflow now allows for release version override and language override. --- .github/workflows/starter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index 8bb12be..6375f85 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -67,7 +67,7 @@ jobs: call-go-build-and-release-workflow: needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow] if: needs.call-get-primary-language.outputs.primary_language == 'Go' - uses: keyfactor/actions/.github/workflows/go-build-and-release.yml@v2 + uses: spbsoluble/actions/.github/workflows/go-build-and-release.yml@voverrides with: release_version: ${{ inputs.release_version_override || needs.call-create-github-release-workflow.outputs.release_version }} secrets: From 3f3e235ee348245e258c34931064a855e233d2ed Mon Sep 17 00:00:00 2001 From: sbailey <1661003+spbsoluble@users.noreply.github.com> Date: Thu, 25 Jan 2024 12:26:23 -0800 Subject: [PATCH 76/95] feat: starter workflow now allows for release version override and language override. --- .github/workflows/starter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index 6375f85..2e2c9a5 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -67,7 +67,7 @@ jobs: call-go-build-and-release-workflow: needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow] if: needs.call-get-primary-language.outputs.primary_language == 'Go' - uses: spbsoluble/actions/.github/workflows/go-build-and-release.yml@voverrides + uses: spbsoluble/actions/.github/workflows/go-build-and-release.yml@overrides with: release_version: ${{ inputs.release_version_override || needs.call-create-github-release-workflow.outputs.release_version }} secrets: From 54de7689094cc95667c09653b7b3a51f2dfd3063 Mon Sep 17 00:00:00 2001 From: sbailey <1661003+spbsoluble@users.noreply.github.com> Date: Thu, 25 Jan 2024 12:37:40 -0800 Subject: [PATCH 77/95] feat: starter workflow now allows for release version override and language override. --- .github/workflows/github-release.yml | 14 ++++++++++++-- .github/workflows/starter.yml | 7 +++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index cda3a07..e3c4f0b 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -1,6 +1,16 @@ name: Create GitHub release version and location on: workflow_call: + inputs: + force_release: + description: Force a release build + required: false + type: boolean + default: false + release_version_override: + description: 'Force a specific release version' + required: false + type: string outputs: release_version: description: The computed release version for the release (or pre-release) being built @@ -122,9 +132,9 @@ jobs: create-github-release: needs: get-versions - if: github.event_name == 'pull_request' && needs.get-versions.outputs.IS_RELEASE_BRANCH == 'True' + if: (github.event_name == 'pull_request' && needs.get-versions.outputs.IS_RELEASE_BRANCH == 'True') || github.event.inputs.force_release == 'true' outputs: - release_version: ${{ steps.create_release.outputs.current_tag }} + release_version: ${{ inputs.release_version_override || steps.create_release.outputs.current_tag }} release_url: ${{ steps.create_release.outputs.upload_url }} runs-on: ubuntu-latest steps: diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index 2e2c9a5..29f34cc 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -10,6 +10,11 @@ on: description: 'Force a specific primary language. Valid values are "C#" and "Go"' required: false type: string + force_release: + description: Force a release build + required: false + type: boolean + default: false secrets: token: description: 'GitHub token' @@ -51,6 +56,8 @@ jobs: call-create-github-release-workflow: uses: Keyfactor/actions/.github/workflows/github-release.yml@v2 + with: + force_release: ${{ inputs.force_release || false }} call-dotnet-build-and-release-workflow: needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow] From fbe55ffe07cd95df895d056f3bf9cb448b599740 Mon Sep 17 00:00:00 2001 From: sbailey <1661003+spbsoluble@users.noreply.github.com> Date: Thu, 25 Jan 2024 12:39:58 -0800 Subject: [PATCH 78/95] feat: starter workflow now allows for release version override and language override. --- .github/workflows/starter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index 29f34cc..b99d26a 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -55,7 +55,7 @@ jobs: echo "primary_language=${{ steps.read.outputs.primary_language}}" | tee -a "$GITHUB_OUTPUT" | tee -a $GITHUB_STEP_SUMMARY call-create-github-release-workflow: - uses: Keyfactor/actions/.github/workflows/github-release.yml@v2 + uses: Keyfactor/actions/.github/workflows/github-release.yml@overrides with: force_release: ${{ inputs.force_release || false }} From 92f4bbc0d97b91128a0da73615d1a370e95e142b Mon Sep 17 00:00:00 2001 From: sbailey <1661003+spbsoluble@users.noreply.github.com> Date: Thu, 25 Jan 2024 12:40:39 -0800 Subject: [PATCH 79/95] feat: starter workflow now allows for release version override and language override. --- .github/workflows/starter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index b99d26a..a1dd0cd 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -55,7 +55,7 @@ jobs: echo "primary_language=${{ steps.read.outputs.primary_language}}" | tee -a "$GITHUB_OUTPUT" | tee -a $GITHUB_STEP_SUMMARY call-create-github-release-workflow: - uses: Keyfactor/actions/.github/workflows/github-release.yml@overrides + uses: spbsoluble/actions/.github/workflows/github-release.yml@overrides with: force_release: ${{ inputs.force_release || false }} From da1c01ec7352e2e4dde5715ff9f87e8df12fada5 Mon Sep 17 00:00:00 2001 From: sbailey <1661003+spbsoluble@users.noreply.github.com> Date: Thu, 25 Jan 2024 12:47:37 -0800 Subject: [PATCH 80/95] feat: starter workflow now allows for release version override and language override. --- .github/workflows/starter.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index a1dd0cd..4a12866 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -77,6 +77,7 @@ jobs: uses: spbsoluble/actions/.github/workflows/go-build-and-release.yml@overrides with: release_version: ${{ inputs.release_version_override || needs.call-create-github-release-workflow.outputs.release_version }} + force_release: ${{ inputs.force_release || false }} secrets: token: ${{ secrets.GITHUB_TOKEN }} gpg_key: ${{ secrets.gpg_key }} From 2551ac1e61affd56572ad725ce32f1ea393ba29e Mon Sep 17 00:00:00 2001 From: sbailey <1661003+spbsoluble@users.noreply.github.com> Date: Thu, 25 Jan 2024 12:57:18 -0800 Subject: [PATCH 81/95] feat: starter workflow now allows for release version override and language override. --- .github/workflows/go-build-and-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index 4fdeae9..3959d7b 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -37,7 +37,7 @@ jobs: cache: true - name: get-is-release run: | - if ("${{ github.event_name }}" == "pull_request" || "${{ inputs.force_release }}" == "true") && "${{ inputs.release_version }}" != "" ]]; then + if [[ ("${{ github.event_name }}" == "pull_request" || "${{ inputs.force_release }}" == "true") && "${{ inputs.release_version }}" != "" ]]; then echo "GO_ARGS=release --clean" | tee -a "$GITHUB_ENV" echo "VERSION=${{ inputs.release_version }}" | tee -a "$GITHUB_ENV" | tee -a "$GITHUB_STEP_SUMMARY" else From 58d554a550c1dc1af5416b2da3e27cd3afd23d9d Mon Sep 17 00:00:00 2001 From: sbailey <1661003+spbsoluble@users.noreply.github.com> Date: Thu, 25 Jan 2024 13:30:47 -0800 Subject: [PATCH 82/95] fix(ci): github-release set outputs --- .github/workflows/github-release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index e3c4f0b..65d59f1 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -107,7 +107,7 @@ jobs: echo "LATEST_TAG=" | tee -a "$GITHUB_ENV" fi - name: Set Outputs - if: github.event_name == 'pull_request' + if: (github.event_name == 'pull_request' || github.event.inputs.force_release == 'true') id: set-outputs run: | echo "PR_BASE_REF=${{ env.PR_BASE_REF }}" | tee -a "$GITHUB_OUTPUT" @@ -120,6 +120,9 @@ jobs: if [[ "${{ env.PR_STATE }}" == "open" ]]; then echo "IS_PRE_RELEASE=True" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" echo "INC_LEVEL=prerelease" | tee -a "$GITHUB_OUTPUT" + elif [[ "${{ github.event.inputs.release_version_override }}" != "" && "${{ github.event.inputs.release_version_override }}" == *"-rc"]]; then + echo "IS_PRE_RELEASE=True" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" + echo "INC_LEVEL=prerelease" | tee -a "$GITHUB_OUTPUT" fi if [[ "${{ env.PR_BASE_REF }}" == "release-"* ]]; then echo "IS_RELEASE_BRANCH=True" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" From d679b018ca709e7be0bf7a3879a91615dcad12f0 Mon Sep 17 00:00:00 2001 From: sbailey <1661003+spbsoluble@users.noreply.github.com> Date: Thu, 25 Jan 2024 13:34:22 -0800 Subject: [PATCH 83/95] fix(ci): github-release set outputs --- .github/workflows/github-release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index 65d59f1..850665c 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -113,6 +113,7 @@ jobs: echo "PR_BASE_REF=${{ env.PR_BASE_REF }}" | tee -a "$GITHUB_OUTPUT" echo "PR_STATE=${{ env.PR_STATE }}" echo "PR_MERGED=${{ env.PR_MERGED }}" + echo "RELEASE_VERSION_OVERRIDE=${{ github.event.inputs.release_version_override }}" >> $GITHUB_ENV if [[ "${{ env.PR_STATE }}" == "closed" && "${{ env.PR_MERGED }}" == "true" && "${{ env.PR_COMMIT_SHA }}" == "${{ env.GITHUB_SHA }}" ]]; then echo "IS_FULL_RELEASE=True" | tee -a "$GITHUB_OUTPUT" echo "INC_LEVEL=patch" | tee -a "$GITHUB_OUTPUT" @@ -120,7 +121,7 @@ jobs: if [[ "${{ env.PR_STATE }}" == "open" ]]; then echo "IS_PRE_RELEASE=True" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" echo "INC_LEVEL=prerelease" | tee -a "$GITHUB_OUTPUT" - elif [[ "${{ github.event.inputs.release_version_override }}" != "" && "${{ github.event.inputs.release_version_override }}" == *"-rc"]]; then + elif [[ -n "$RELEASE_VERSION_OVERRIDE" && "$RELEASE_VERSION_OVERRIDE" == *"-rc" ]]; then echo "IS_PRE_RELEASE=True" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" echo "INC_LEVEL=prerelease" | tee -a "$GITHUB_OUTPUT" fi From 01f92d4a6d5323cb68c57377a2759f7f3a7c1e59 Mon Sep 17 00:00:00 2001 From: sbailey <1661003+spbsoluble@users.noreply.github.com> Date: Thu, 25 Jan 2024 13:42:18 -0800 Subject: [PATCH 84/95] fix(ci): github-release set outputs --- .github/workflows/go-build-and-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index 3959d7b..6459973 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -38,8 +38,8 @@ jobs: - name: get-is-release run: | if [[ ("${{ github.event_name }}" == "pull_request" || "${{ inputs.force_release }}" == "true") && "${{ inputs.release_version }}" != "" ]]; then - echo "GO_ARGS=release --clean" | tee -a "$GITHUB_ENV" echo "VERSION=${{ inputs.release_version }}" | tee -a "$GITHUB_ENV" | tee -a "$GITHUB_STEP_SUMMARY" + echo "GO_ARGS=release --version inputs.release_version --clean" | tee -a "$GITHUB_ENV" else echo "GO_ARGS=build --snapshot" | tee -a "$GITHUB_ENV" echo "VERSION=0.0.0" | tee -a "$GITHUB_ENV" | tee -a "$GITHUB_STEP_SUMMARY" From 1a0ebadd8adf086f3276dc06923ba829808a70eb Mon Sep 17 00:00:00 2001 From: sbailey <1661003+spbsoluble@users.noreply.github.com> Date: Thu, 25 Jan 2024 13:42:42 -0800 Subject: [PATCH 85/95] fix(ci): github-release set outputs --- .github/workflows/go-build-and-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index 6459973..93adc8c 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -41,7 +41,7 @@ jobs: echo "VERSION=${{ inputs.release_version }}" | tee -a "$GITHUB_ENV" | tee -a "$GITHUB_STEP_SUMMARY" echo "GO_ARGS=release --version inputs.release_version --clean" | tee -a "$GITHUB_ENV" else - echo "GO_ARGS=build --snapshot" | tee -a "$GITHUB_ENV" + echo "GO_ARGS=build --version inputs.release_version --snapshot" | tee -a "$GITHUB_ENV" echo "VERSION=0.0.0" | tee -a "$GITHUB_ENV" | tee -a "$GITHUB_STEP_SUMMARY" fi - name: Import GPG key From ebe580c296aaefe22d53f52738df766ee493b31e Mon Sep 17 00:00:00 2001 From: sbailey <1661003+spbsoluble@users.noreply.github.com> Date: Thu, 25 Jan 2024 13:44:45 -0800 Subject: [PATCH 86/95] fix(ci): github-release set outputs --- .github/workflows/go-build-and-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index 93adc8c..1647895 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -39,9 +39,9 @@ jobs: run: | if [[ ("${{ github.event_name }}" == "pull_request" || "${{ inputs.force_release }}" == "true") && "${{ inputs.release_version }}" != "" ]]; then echo "VERSION=${{ inputs.release_version }}" | tee -a "$GITHUB_ENV" | tee -a "$GITHUB_STEP_SUMMARY" - echo "GO_ARGS=release --version inputs.release_version --clean" | tee -a "$GITHUB_ENV" + echo "GO_ARGS=release --version ${{ inputs.release_version }} --clean" | tee -a "$GITHUB_ENV" else - echo "GO_ARGS=build --version inputs.release_version --snapshot" | tee -a "$GITHUB_ENV" + echo "GO_ARGS=build --version ${{ inputs.release_version }} --snapshot" | tee -a "$GITHUB_ENV" echo "VERSION=0.0.0" | tee -a "$GITHUB_ENV" | tee -a "$GITHUB_STEP_SUMMARY" fi - name: Import GPG key From 1b298a145ad9261c5a01c84df01e7da033d70d92 Mon Sep 17 00:00:00 2001 From: sbailey <1661003+spbsoluble@users.noreply.github.com> Date: Thu, 25 Jan 2024 13:47:44 -0800 Subject: [PATCH 87/95] fix(ci): github-release set outputs --- .github/workflows/go-build-and-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index 1647895..80e75bd 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -39,9 +39,9 @@ jobs: run: | if [[ ("${{ github.event_name }}" == "pull_request" || "${{ inputs.force_release }}" == "true") && "${{ inputs.release_version }}" != "" ]]; then echo "VERSION=${{ inputs.release_version }}" | tee -a "$GITHUB_ENV" | tee -a "$GITHUB_STEP_SUMMARY" - echo "GO_ARGS=release --version ${{ inputs.release_version }} --clean" | tee -a "$GITHUB_ENV" + echo "GO_ARGS=release --version "${{ inputs.release_version }}" --clean" | tee -a "$GITHUB_ENV" else - echo "GO_ARGS=build --version ${{ inputs.release_version }} --snapshot" | tee -a "$GITHUB_ENV" + echo "GO_ARGS=build --version "${{ inputs.release_version }}" --snapshot" | tee -a "$GITHUB_ENV" echo "VERSION=0.0.0" | tee -a "$GITHUB_ENV" | tee -a "$GITHUB_STEP_SUMMARY" fi - name: Import GPG key From c82314aedca9becfc9eba74d91d5799a8e2821d5 Mon Sep 17 00:00:00 2001 From: sbailey <1661003+spbsoluble@users.noreply.github.com> Date: Thu, 25 Jan 2024 13:52:22 -0800 Subject: [PATCH 88/95] fix(ci): github-release set outputs --- .github/workflows/github-release.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index 850665c..5ff46de 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -138,7 +138,7 @@ jobs: needs: get-versions if: (github.event_name == 'pull_request' && needs.get-versions.outputs.IS_RELEASE_BRANCH == 'True') || github.event.inputs.force_release == 'true' outputs: - release_version: ${{ inputs.release_version_override || steps.create_release.outputs.current_tag }} + release_version: ${{ github.event.inputs.release_version_override || || steps.create_release.outputs.current_tag }} release_url: ${{ steps.create_release.outputs.upload_url }} runs-on: ubuntu-latest steps: @@ -148,10 +148,10 @@ jobs: if: needs.get-versions.outputs.LATEST_TAG == '' run: | echo "INITIAL_VERSION=${{needs.get-versions.outputs.PR_BASE_TAG}}.0-rc.0" | tee -a "$GITHUB_STEP_SUMMARY" | tee -a "$GITHUB_ENV" - echo "MANUAL_VERSION=${{needs.get-versions.outputs.PR_BASE_TAG}}.0-rc.0" | tee -a "$GITHUB_ENV" + echo "MANUAL_VERSION=${{ github.event.inputs.release_version_override || needs.get-versions.outputs.PR_BASE_TAG}}.0-rc.0" | tee -a "$GITHUB_ENV" - name: Set semver info id: set-semver-info - if: needs.get-versions.outputs.LATEST_TAG != '' + if: needs.get-versions.outputs.LATEST_TAG != '' uses: fiddlermikey/action-bump-semver@main with: current_version: ${{ needs.get-versions.outputs.LATEST_TAG}} @@ -160,16 +160,16 @@ jobs: - name: Show next sem-version if: needs.get-versions.outputs.LATEST_TAG != '' run: | - echo "MANUAL_VERSION=${{ steps.set-semver-info.outputs.new_version }}" > "$GITHUB_ENV" + echo "MANUAL_VERSION=${{ github.event.inputs.release_version_override || steps.set-semver-info.outputs.new_version }}" > "$GITHUB_ENV" - run: | - echo "Next version: ${{ env.MANUAL_VERSION }}" | tee -a "$GITHUB_STEP_SUMMARY" + echo "Next version: ${{ github.event.inputs.release_version_override || env.MANUAL_VERSION }}" | tee -a "$GITHUB_STEP_SUMMARY" - name: Create new release id: create_release uses: keyfactor/action-create-release@v3 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - MANUAL_VERSION: ${{ env.MANUAL_VERSION }} - if: github.event_name == 'pull_request' && needs.get-versions.outputs.IS_RELEASE_BRANCH == 'True' + MANUAL_VERSION: ${{ github.event.inputs.release_version_override || env.MANUAL_VERSION }} + if: (github.event_name == 'pull_request' && needs.get-versions.outputs.IS_RELEASE_BRANCH == 'True') || github.event.inputs.force_release == 'true' with: release_name: ${{ env.MANUAL_VERSION }} body: | From 175b20558875be841193bda64f5adce783787029 Mon Sep 17 00:00:00 2001 From: sbailey <1661003+spbsoluble@users.noreply.github.com> Date: Thu, 25 Jan 2024 13:53:31 -0800 Subject: [PATCH 89/95] fix(ci): github-release set outputs --- .github/workflows/github-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index 5ff46de..e28288b 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -138,7 +138,7 @@ jobs: needs: get-versions if: (github.event_name == 'pull_request' && needs.get-versions.outputs.IS_RELEASE_BRANCH == 'True') || github.event.inputs.force_release == 'true' outputs: - release_version: ${{ github.event.inputs.release_version_override || || steps.create_release.outputs.current_tag }} + release_version: ${{ github.event.inputs.release_version_override || steps.create_release.outputs.current_tag }} release_url: ${{ steps.create_release.outputs.upload_url }} runs-on: ubuntu-latest steps: From 51ae66e0fd0821a91c4354063ae202ad3010554c Mon Sep 17 00:00:00 2001 From: sbailey <1661003+spbsoluble@users.noreply.github.com> Date: Thu, 25 Jan 2024 14:00:20 -0800 Subject: [PATCH 90/95] fix(ci): github-release set outputs --- .github/workflows/github-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index e28288b..61a4c1c 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -121,7 +121,7 @@ jobs: if [[ "${{ env.PR_STATE }}" == "open" ]]; then echo "IS_PRE_RELEASE=True" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" echo "INC_LEVEL=prerelease" | tee -a "$GITHUB_OUTPUT" - elif [[ -n "$RELEASE_VERSION_OVERRIDE" && "$RELEASE_VERSION_OVERRIDE" == *"-rc" ]]; then + elif [[ -n "${{ github.event.inputs.release_version_override }}" && "${{ github.event.inputs.release_version_override }}" == *"-rc" ]]; then echo "IS_PRE_RELEASE=True" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" echo "INC_LEVEL=prerelease" | tee -a "$GITHUB_OUTPUT" fi From 407ade703a470cfa0fe56bcb016a8b241d19eb49 Mon Sep 17 00:00:00 2001 From: sbailey <1661003+spbsoluble@users.noreply.github.com> Date: Fri, 26 Jan 2024 07:40:46 -0800 Subject: [PATCH 91/95] fix(ci): github-release set outputs --- .github/workflows/github-release.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index 61a4c1c..7ad71c4 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -120,10 +120,10 @@ jobs: fi if [[ "${{ env.PR_STATE }}" == "open" ]]; then echo "IS_PRE_RELEASE=True" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" - echo "INC_LEVEL=prerelease" | tee -a "$GITHUB_OUTPUT" - elif [[ -n "${{ github.event.inputs.release_version_override }}" && "${{ github.event.inputs.release_version_override }}" == *"-rc" ]]; then + echo "INC_LEVEL=prerelease" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" + elif [ [ -n "${{ github.event.inputs.release_version_override }}" ] && [ "${{ github.event.inputs.release_version_override }}" == *"-rc" ]]; then echo "IS_PRE_RELEASE=True" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" - echo "INC_LEVEL=prerelease" | tee -a "$GITHUB_OUTPUT" + echo "INC_LEVEL=prerelease" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" fi if [[ "${{ env.PR_BASE_REF }}" == "release-"* ]]; then echo "IS_RELEASE_BRANCH=True" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" @@ -171,7 +171,7 @@ jobs: MANUAL_VERSION: ${{ github.event.inputs.release_version_override || env.MANUAL_VERSION }} if: (github.event_name == 'pull_request' && needs.get-versions.outputs.IS_RELEASE_BRANCH == 'True') || github.event.inputs.force_release == 'true' with: - release_name: ${{ env.MANUAL_VERSION }} + release_name: ${{ github.event.inputs.release_version_override || env.MANUAL_VERSION }} body: | [Changelog](/./CHANGELOG.md) [Readme](/./README.md) @@ -179,7 +179,7 @@ jobs: draft: false prerelease: ${{ needs.get-versions.outputs.IS_PRE_RELEASE == 'True'}} prerelease_suffix: rc - tag_name: ${{ env.MANUAL_VERSION }} + tag_name: ${{ github.event.inputs.release_version_override || env.MANUAL_VERSION }} auto_increment_type: ${{ (needs.get-versions.outputs.IS_PRE_RELEASE == 'True') && 'prerelease' || 'patch' }} tag_schema: semantic commitish: ${{ github.sha }} From 8221727a85ef4d629faef9f032ee05d7e56165b2 Mon Sep 17 00:00:00 2001 From: sbailey <1661003+spbsoluble@users.noreply.github.com> Date: Fri, 26 Jan 2024 07:43:23 -0800 Subject: [PATCH 92/95] fix(ci): github-release set outputs --- .github/workflows/github-release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index 7ad71c4..0f5005b 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -119,13 +119,16 @@ jobs: echo "INC_LEVEL=patch" | tee -a "$GITHUB_OUTPUT" fi if [[ "${{ env.PR_STATE }}" == "open" ]]; then + echo "Processing open PR" echo "IS_PRE_RELEASE=True" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" echo "INC_LEVEL=prerelease" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" - elif [ [ -n "${{ github.event.inputs.release_version_override }}" ] && [ "${{ github.event.inputs.release_version_override }}" == *"-rc" ]]; then + elif [ [ -n "${{ github.event.inputs.release_version_override }}" ] && [ "${{ github.event.inputs.release_version_override }}" == *"-rc." ]]; then + echo "Force create release using override version ${{ github.event.inputs.release_version_override }}" echo "IS_PRE_RELEASE=True" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" echo "INC_LEVEL=prerelease" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" fi if [[ "${{ env.PR_BASE_REF }}" == "release-"* ]]; then + echo "Processing a release branch" echo "IS_RELEASE_BRANCH=True" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" fi echo "PR_COMMIT_SHA=${{ env.PR_COMMIT_SHA }}" | tee -a "$GITHUB_OUTPUT" From 19f46d340ed9c1a888a420c89c017f873c30f509 Mon Sep 17 00:00:00 2001 From: sbailey <1661003+spbsoluble@users.noreply.github.com> Date: Fri, 26 Jan 2024 08:00:22 -0800 Subject: [PATCH 93/95] ci revert --- .github/workflows/github-release.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index 0f5005b..5dd55d1 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -122,10 +122,14 @@ jobs: echo "Processing open PR" echo "IS_PRE_RELEASE=True" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" echo "INC_LEVEL=prerelease" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" - elif [ [ -n "${{ github.event.inputs.release_version_override }}" ] && [ "${{ github.event.inputs.release_version_override }}" == *"-rc." ]]; then + elif [[ -n "${{ github.event.inputs.release_version_override }}" ] && [ "${{ github.event.inputs.release_version_override }}" == *"-rc." ]]; then echo "Force create release using override version ${{ github.event.inputs.release_version_override }}" echo "IS_PRE_RELEASE=True" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" echo "INC_LEVEL=prerelease" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" + else + echo "Neither open PR nor release override version, defaulting to prerelease" + echo "IS_PRE_RELEASE=True" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" + echo "INC_LEVEL=prerelease" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" fi if [[ "${{ env.PR_BASE_REF }}" == "release-"* ]]; then echo "Processing a release branch" From 3e7234fa2521febaf0b79d2c03ef447b04cda8e7 Mon Sep 17 00:00:00 2001 From: sbailey <1661003+spbsoluble@users.noreply.github.com> Date: Fri, 26 Jan 2024 08:02:09 -0800 Subject: [PATCH 94/95] ci revert --- .github/workflows/github-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index 5dd55d1..fd78da5 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -122,7 +122,7 @@ jobs: echo "Processing open PR" echo "IS_PRE_RELEASE=True" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" echo "INC_LEVEL=prerelease" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" - elif [[ -n "${{ github.event.inputs.release_version_override }}" ] && [ "${{ github.event.inputs.release_version_override }}" == *"-rc." ]]; then + elif [[ -n "${{ github.event.inputs.release_version_override }}" && "${{ github.event.inputs.release_version_override }}" == *"-rc." ]]; then echo "Force create release using override version ${{ github.event.inputs.release_version_override }}" echo "IS_PRE_RELEASE=True" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" echo "INC_LEVEL=prerelease" | tee -a "$GITHUB_OUTPUT" | tee -a "$GITHUB_ENV" From 62825ac814580918784b93aff3b63e02312bdec6 Mon Sep 17 00:00:00 2001 From: sbailey <1661003+spbsoluble@users.noreply.github.com> Date: Fri, 26 Jan 2024 08:10:22 -0800 Subject: [PATCH 95/95] args fix --- .github/workflows/go-build-and-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go-build-and-release.yml b/.github/workflows/go-build-and-release.yml index 80e75bd..8242b9a 100644 --- a/.github/workflows/go-build-and-release.yml +++ b/.github/workflows/go-build-and-release.yml @@ -39,9 +39,9 @@ jobs: run: | if [[ ("${{ github.event_name }}" == "pull_request" || "${{ inputs.force_release }}" == "true") && "${{ inputs.release_version }}" != "" ]]; then echo "VERSION=${{ inputs.release_version }}" | tee -a "$GITHUB_ENV" | tee -a "$GITHUB_STEP_SUMMARY" - echo "GO_ARGS=release --version "${{ inputs.release_version }}" --clean" | tee -a "$GITHUB_ENV" + echo "GO_ARGS=release --version '${{ inputs.release_version }}' --clean" | tee -a "$GITHUB_ENV" else - echo "GO_ARGS=build --version "${{ inputs.release_version }}" --snapshot" | tee -a "$GITHUB_ENV" + echo "GO_ARGS=build --version '${{ inputs.release_version }}' --snapshot" | tee -a "$GITHUB_ENV" echo "VERSION=0.0.0" | tee -a "$GITHUB_ENV" | tee -a "$GITHUB_STEP_SUMMARY" fi - name: Import GPG key