Skip to content

Commit 7c4382e

Browse files
authored
Merge pull request #98 from ASFHyP3/develop
Release v0.5.0
2 parents 5ca93e8 + 037b7ed commit 7c4382e

28 files changed

+127
-71
lines changed

.github/workflows/changelog.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ on:
1313

1414
jobs:
1515
call-changelog-check-workflow:
16-
uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@v0.17.1
16+
uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@v0.18.0

.github/workflows/create-jira-issue.yml

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

77
jobs:
88
call-create-jira-issue-workflow:
9-
uses: ASFHyP3/actions/.github/workflows/reusable-create-jira-issue.yml@v0.17.1
9+
uses: ASFHyP3/actions/.github/workflows/reusable-create-jira-issue.yml@v0.18.0
1010
secrets:
1111
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
1212
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}

.github/workflows/labeled-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ on:
1212

1313
jobs:
1414
call-labeled-pr-check-workflow:
15-
uses: ASFHyP3/actions/.github/workflows/reusable-labeled-pr-check.yml@v0.17.1
15+
uses: ASFHyP3/actions/.github/workflows/reusable-labeled-pr-check.yml@v0.18.0

.github/workflows/release.yml

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

88
jobs:
99
call-release-workflow:
10-
uses: ASFHyP3/actions/.github/workflows/reusable-release.yml@v0.17.1
10+
uses: ASFHyP3/actions/.github/workflows/reusable-release.yml@v0.18.0
1111
with:
1212
release_prefix: HyP3 Cookiecutter
1313
secrets:
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Render Cookiecutter
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- develop
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/[email protected]
14+
with:
15+
path: hyp3-cookiecutter
16+
17+
- name: Render Cookiecutter
18+
uses: andrewthetechie/[email protected]
19+
with:
20+
template: ./hyp3-cookiecutter
21+
# Any values not filled in will be set to template's default
22+
cookiecutterValues: '{
23+
"github_username": "foo-bar",
24+
"github_email": "[email protected]",
25+
"process_type": "foo-bar"
26+
}'

.github/workflows/static-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ on: push
44

55
jobs:
66
call-secrets-analysis-workflow:
7-
uses: ASFHyP3/actions/.github/workflows/reusable-secrets-analysis.yml@v0.17.1
7+
uses: ASFHyP3/actions/.github/workflows/reusable-secrets-analysis.yml@v0.18.0

.github/workflows/tag-version.yml

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

88
jobs:
99
call-bump-version-workflow:
10-
uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@v0.17.1
10+
uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@v0.18.0
1111
secrets:
1212
USER_TOKEN: ${{ secrets.TOOLS_BOT_PAK }}

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/)
77
and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
88

9+
10+
## [0.5.0]
11+
### Added
12+
- Added a CLI option to specify the name of a user GitHub Token in the rendered plugin for the GitHub Actions workflows that require it.
13+
- A GitHub Actions workflow that will ensure hyp3-cookiecutter renders.
14+
### Fixed
15+
- Fixed project name variable error which prevented the cookiecutter from rendering.
16+
917
## [0.4.0]
1018
### Changed
1119
- In the generated project, ruff and mypy dependencies are now statically pinned and kept up to date with dependabot to prevent updates introducing unexpected static analysis failures

README.md

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,43 @@ generate a new HyP3 Plugin.
77

88
### 1. Create the plugin with Cookiecutter
99

10-
To create a new plugin, you'll first need to run the cookicutter.
11-
From a terminal on your local development machine, navigate to where you'd like
12-
to create the local copy of the plugin's repository. Then run cookiecutter and
13-
follow the prompts:
10+
To create a new plugin, you'll first need to run [`cookiecutter`](https://cookiecutter.readthedocs.io/en/stable/), which you can install with [`conda`/`mamba`](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html)
11+
(we recommend [MiniForge](https://conda-forge.org/download/)):
1412

1513
```bash
16-
python3 -m pip install cookiecutter
14+
mamba install cookiecutter
15+
```
16+
17+
or [`pip`](https://packaging.python.org/en/latest/tutorials/installing-packages/#use-pip-for-installing):
18+
19+
```bash
20+
python -m pip install cookiecutter
21+
```
22+
23+
Then, from a terminal on your local development machine, navigate to where you'd like
24+
to create the local copy of your new plugin's repository and run cookiecutter, following the prompts.
25+
26+
For example, this may look like:
27+
28+
```
1729
cookiecutter https://github.com/ASFHyP3/hyp3-cookiecutter.git
30+
[1/7] github_username (username_for_github_actions): foo
31+
[2/7] github_email (email_for@github_actions.com): [email protected]
32+
[3/7] github_actions_token (FOO_PAK):
33+
[4/7] process_type (RTC): foo-bar
34+
[5/7] short_description (HyP3 plugin for foo-bar processing.):
35+
[6/7] public_url (https://github.com/ASFHyP3/hyp3-foo-bar):
36+
[7/7] copyright_year (2025):
1837
```
1938

20-
Now, you should have a `hyp3-<process>` directory which contains a minimal HyP3
21-
plugin.
39+
> [!TIP]
40+
> The `github_*` prompts facilitate the CI/CD pipelines included in the cookiecutter. These can be for yourself, or a shared team "bot" user, and we'll set up a Personal Access Token in [Section 6](#6-create-a-personal-access-key-for-github-actions).
41+
42+
Now, you should have a `hyp3-<process_type>` (`hyp3-foo-bar` in the example above) directory which contains a minimal HyP3 plugin.
2243

2344
### 2. Create a repository on GitHub
2445

2546
Next, we'll need to create a new repository on [GitHub](https://github.com) for your plugin.
26-
Make sure to create your repository in the same user/organization account you set in the
27-
`<GITHUB_USERNAME>` field of the cookiecutter.
2847

2948
Your repository name should be the same as the directory name for the plugin you created
3049
on your local develop machine. (e.g., `hyp3-<PROCESS_TYPE>`). For the description section,
@@ -136,16 +155,16 @@ article
136155
### 6. Create a personal access key for GitHub Actions
137156

138157
Some of the GitHub actions (`release.yml` and `tag-version.yml`) need extra permissions to work
139-
properly. These actions will attempt to use the `GITHUB_PAK` secret to assume a user profile
140-
with the needed permissions, so we'll need to create the permissions/secret.
158+
properly and will attempt to assume those permission via a repository secret named `<github_actions_token>`.
159+
So, if it doesn't already exist, we will need to create the token.
141160

142161
1. In your user/organization settings:
143162
* Click on Developer Settings
144163
* Click on Personal access tokens
145164
* Click Tokens (classic)
146165
* Click Generate new token
147166
* Click Generate new token (classic)
148-
* In the note section give the token a name (e.g., `GITHUB_PAK`)
167+
* In the note section give the token a name (e.g., `<GH_ACCOUNT_NAME>_PAK`)
149168
* Check the boxes for:
150169
* repo
151170
* workflow
@@ -158,7 +177,7 @@ with the needed permissions, so we'll need to create the permissions/secret.
158177
* Click on Secrets and variables
159178
* Click on Actions
160179
* Click on New repository Secret
161-
* Name your secret `GITHUB_PAK`
180+
* Name your secret `<GH_ACCOUNT_NAME>_PAK`
162181
* Paste in the access token you save from the last step
163182
* Click Add secret
164183

@@ -197,5 +216,3 @@ for a step-by-step guide.
197216

198217
### GITHUB_PAK Permissions
199218
![GITHUB_PAK Permissions screenshot](assets/PAK_permissions.png)
200-
201-

cookiecutter.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
{
22
"github_username": "username_for_github_actions",
33
"github_email": "email_for@github_actions.com",
4+
"github_actions_token": "{{ cookiecutter.github_username | upper | replace('-', '_') + '_PAK' }}",
5+
"__user_github_token": "{{ '${{ secrets.' + cookiecutter.github_actions_token + ' }}' }}",
46
"process_type": "RTC",
5-
"short_description": "HyP3 plugin for {{cookiecutter.process_type}} processing.",
6-
"public_url": "https://github.com/ASFHyP3/hyp3-{{cookiecutter.process_type}}",
7+
"short_description": "HyP3 plugin for {{ cookiecutter.process_type }} processing.",
8+
"public_url": "https://github.com/ASFHyP3/hyp3-{{ cookiecutter.process_type }}",
79
"copyright_year": "{% now 'utc', '%Y' %}",
8-
"__project_name": "hyp3-{{cookiecutter.process_type | lower}}",
9-
"__project_title": "HyP3 {{cookiecutter.process_type}}",
10-
"__package_name": "hyp3_{{cookiecutter.process_type | lower | replace('-', '_')}}",
11-
"__process_name": "process_{{cookiecutter.process_type | lower | replace('-', '_')}}"
10+
"__project_name": "hyp3-{{ cookiecutter.process_type | lower }}",
11+
"__project_title": "HyP3 {{ cookiecutter.process_type }}",
12+
"__package_name": "hyp3_{{ cookiecutter.process_type | lower | replace('-', '_') }}",
13+
"__process_name": "process_{{ cookiecutter.process_type | lower | replace('-', '_') }}"
1214
}

0 commit comments

Comments
 (0)