From 48414f9094af776da956814ac546247d4f43f9f9 Mon Sep 17 00:00:00 2001 From: Mikey Henderson <4452096+fiddlermikey@users.noreply.github.com> Date: Fri, 28 Jun 2024 16:47:48 -0700 Subject: [PATCH] Ab#57356 doctool (#87) (#88) Create initial v3.0.0 and cannoical tags * ab#57356 Transition to doctool * ab#57423 Update all actions to use v3 tag * use keyfactor org actions * use actions v3 for generate-readme.yml * minor update to readme --------- Co-authored-by: Michael Henderson --- .github/workflows/generate-readme.yml | 38 +++------------------------ .github/workflows/starter.yml | 32 +++++++++++----------- README.md | 6 +++-- 3 files changed, 25 insertions(+), 51 deletions(-) diff --git a/.github/workflows/generate-readme.yml b/.github/workflows/generate-readme.yml index fbff3b3..6ddbfef 100644 --- a/.github/workflows/generate-readme.yml +++ b/.github/workflows/generate-readme.yml @@ -5,44 +5,14 @@ on: token: description: 'Secret token from caller workflow to approve readme' required: true +permissions: + contents: write jobs: - generate-readme: + update-docs: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - name: Checkout project + - uses: Keyfactor/doctool@main with: token: ${{ secrets.token }} - - uses: actions/checkout@v4 - name: Checkout templates - with: - repository: 'Keyfactor/actions' - path: './actions/' - token: ${{ secrets.token }} - ref: 'v2' # Update this tag for testing new readme templates branches - - uses: Keyfactor/jinja2-action@v1.2.0-multiple-data-files - name: Merge template and manifest with jinja2 - with: - template: ./actions/readme-templates/readme.md.tpl - output_file: README.md - data_file: | - integration-manifest.json - ./actions/readme-templates/readme_shared_data.json - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Show generated README.md - run: echo $(cat README.md) - - - uses: Keyfactor/add-and-commit@v9.1.4 - name: Commit generated README - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - add: README.md --force - message: Update generated README - author_name: Keyfactor - author_email: keyfactor@keyfactor.github.io diff --git a/.github/workflows/starter.yml b/.github/workflows/starter.yml index 8df7ba8..1437ea3 100644 --- a/.github/workflows/starter.yml +++ b/.github/workflows/starter.yml @@ -24,7 +24,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@v3 call-get-primary-language: outputs: @@ -33,12 +33,12 @@ jobs: name: Detect Primary Language steps: - name: Checkout - uses: actions/checkout@v4 + uses: keyfactor/checkout@v4 with: token: ${{ secrets.GITHUB_TOKEN }} - name: Read primary language id: read - uses: fiddlermikey/action-get-primary-language@v2 + uses: keyfactor/action-get-primary-language@v2 with: token: ${{ secrets.GITHUB_TOKEN }} - name: Display type @@ -58,7 +58,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - name: Check file existence id: check_files - uses: andstor/file-existence-action@v3 + uses: keyfactor/file-existence-action@v3 with: files: ".goreleaser.y*ml" @@ -68,7 +68,7 @@ jobs: platform_matrix: ${{ steps.vars.outputs.platform_matrix }} steps: - name: Checkout - uses: actions/checkout@v4 + uses: keyfactor/checkout@v4 with: token: ${{ secrets.GITHUB_TOKEN }} - name: Create an array from platform_list input # @@ -77,12 +77,12 @@ jobs: echo "platform_matrix=`cat integration-manifest.json | jq '.platform_matrix'`" | 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@v3 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@v3 with: release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} release_url: ${{ needs.call-create-github-release-workflow.outputs.release_url }} @@ -94,7 +94,7 @@ jobs: call-go-build-and-release-workflow: needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow,call-goreleaser-exists] if: needs.call-get-primary-language.outputs.primary_language == 'Go' && needs.call-goreleaser-exists.outputs.goreleaser-exists == 'true' - uses: keyfactor/actions/.github/workflows/go-build-and-release.yml@v2 + uses: keyfactor/actions/.github/workflows/go-build-and-release.yml@v3 with: release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} secrets: @@ -105,7 +105,7 @@ jobs: call-container-build-and-release-workflow: needs: [call-get-primary-language, call-assign-from-json-workflow, call-create-github-release-workflow,call-goreleaser-exists,setup_platforms] if: needs.call-get-primary-language.outputs.primary_language == 'Go' && needs.call-goreleaser-exists.outputs.goreleaser-exists == 'false' - uses: keyfactor/actions/.github/workflows/container-build-and-release.yml@v2 + uses: keyfactor/actions/.github/workflows/container-build-and-release.yml@v3 with: release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} platform_list: ${{ fromJson(needs.setup_platforms.outputs.platform_matrix) }} @@ -116,7 +116,7 @@ jobs: call-maven-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 == 'Java' - uses: keyfactor/actions/.github/workflows/maven-build-and-release.yml@v2 + uses: keyfactor/actions/.github/workflows/maven-build-and-release.yml@v3 with: release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} release_url: ${{ needs.call-create-github-release-workflow.outputs.release_url }} @@ -126,27 +126,29 @@ jobs: call-generate-readme-workflow: if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' - uses: Keyfactor/actions/.github/workflows/generate-readme.yml@v2 + uses: Keyfactor/actions/.github/workflows/generate-readme.yml@v3 secrets: - token: ${{ secrets.APPROVE_README_PUSH }} + token: ${{ secrets.token }} call-update-catalog-workflow: needs: call-assign-from-json-workflow if: needs.call-assign-from-json-workflow.outputs.update_catalog == 'true' && github.ref_name == 'main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') - uses: Keyfactor/actions/.github/workflows/update-catalog.yml@v2 + uses: Keyfactor/actions/.github/workflows/update-catalog.yml@v3 secrets: token: ${{ secrets.token }} call-repository-configuration-workflow: if: github.event_name == 'create' && startsWith(github.ref, 'refs/heads/release-') - uses: Keyfactor/actions/.github/workflows/kf-configure-repo.yml@v2 + uses: Keyfactor/actions/.github/workflows/kf-configure-repo.yml@v3 secrets: token: ${{ secrets.token }} + ## Targets below this line have not been tested + #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@v2 + # uses: Keyfactor/actions/.github/workflows/kf-post-release.yml@v3 # secrets: # token: ${{ secrets.token }} diff --git a/README.md b/README.md index 6ee09ea..5ee00ab 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -### πŸ‘¨πŸΏβ€πŸš€ Actions v2 Workflows +### πŸ‘¨πŸΏβ€πŸš€ Actions v3 Workflows + +#### The v3 Actions make use of doctool. 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 +12,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 v3 Actions perform the following steps: * Checkout integration repository * Get values from integration-manifest.json [***assign-env-from-json***]