Skip to content

Commit

Permalink
Ab#57356 doctool (#87) (#88)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
fiddlermikey and Michael Henderson authored Jun 28, 2024
1 parent 83d4feb commit 48414f9
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 51 deletions.
38 changes: 4 additions & 34 deletions .github/workflows/generate-readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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/[email protected]
name: Commit generated README
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
add: README.md --force
message: Update generated README
author_name: Keyfactor
author_email: [email protected]
32 changes: 17 additions & 15 deletions .github/workflows/starter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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"

Expand All @@ -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 #
Expand All @@ -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 }}
Expand All @@ -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:
Expand All @@ -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) }}
Expand All @@ -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 }}
Expand All @@ -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 }}

6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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***]
Expand Down

0 comments on commit 48414f9

Please sign in to comment.