Skip to content

Commit 6c228c6

Browse files
authored
Merge pull request #108 from crazy-max/pep440
PEP 440 support
2 parents 8a0bc9f + a1770d2 commit 6c228c6

14 files changed

Lines changed: 25076 additions & 14136 deletions

README.md

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ ___
2323
* [`tags` input](#tags-input)
2424
* [`type=schedule`](#typeschedule)
2525
* [`type=semver`](#typesemver)
26+
* [`type=pep440`](#typepep440)
2627
* [`type=match`](#typematch)
2728
* [`type=edge`](#typeedge)
2829
* [`type=ref`](#typeref)
@@ -384,11 +385,11 @@ tags: |
384385
```
385386

386387
Will be used on a [push tag event](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#push)
387-
and requires a valid Git tag [semver](https://semver.org/) but you can also use a custom value through `value`
388+
and requires a valid [semver](https://semver.org/) Git tag, but you can also use a custom value through `value`
388389
attribute.
389390

390391
`pattern` attribute supports [Handlebars template](https://handlebarsjs.com/guide/) with the following expressions:
391-
* `raw` ; the actual semver
392+
* `raw` ; the actual tag
392393
* `version` ; shorthand for `{{major}}.{{minor}}.{{patch}}` (can include pre-release)
393394
* `major` ; major version identifier
394395
* `minor` ; minor version identifier
@@ -416,6 +417,51 @@ tags: |
416417
type=semver,enable=true,priority=900,prefix=,suffix=,pattern=,value=
417418
```
418419

420+
### `type=pep440`
421+
422+
```yaml
423+
tags: |
424+
# minimal
425+
type=pep440,pattern={{version}}
426+
# use custom value instead of git tag
427+
type=pep440,pattern={{version}},value=1.0.0
428+
```
429+
430+
Will be used on a [push tag event](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#push)
431+
and requires a Git tag that conforms to [PEP 440](https://www.python.org/dev/peps/pep-0440/), but you can also use a
432+
custom value through `value` attribute.
433+
434+
`pattern` attribute supports [Handlebars template](https://handlebarsjs.com/guide/) with the following expressions:
435+
* `raw` ; the actual tag
436+
* `version` ; cleaned version
437+
* `major` ; major version identifier
438+
* `minor` ; minor version identifier
439+
* `patch` ; patch version identifier
440+
441+
| Git tag | Pattern | Output |
442+
|--------------------|----------------------------------------------------------|----------------------|
443+
| `1.2.3` | `{{raw}}` | `1.2.3` |
444+
| `1.2.3` | `{{version}}` | `1.2.3` |
445+
| `v1.2.3` | `{{version}}` | `1.2.3` |
446+
| `1.2.3` | `{{major}}.{{minor}}` | `1.2` |
447+
| `1.2.3` | `v{{major}}` | `v1` |
448+
| `1.2.3rc2` | `{{raw}}` | `1.2.3rc2`* |
449+
| `1.2.3rc2` | `{{version}}` | `1.2.3rc2` |
450+
| `1.2.3rc2` | `{{major}}.{{minor}}` | `1.2.3rc2`* |
451+
| `1.2.3post1` | `{{major}}.{{minor}}` | `1.2.3.post1`* |
452+
| `1.2.3beta2` | `{{major}}.{{minor}}` | `1.2.3b2`* |
453+
| `1.0dev4` | `{{major}}.{{minor}}` | `1.0.dev4`* |
454+
455+
> *dev/pre/post release will only extend `{{version}}` as tag because they are updated frequently,
456+
> and contain many breaking changes that are (by the author's design) not yet fit for public consumption.
457+
458+
Extended attributes and default values:
459+
460+
```yaml
461+
tags: |
462+
type=pep440,enable=true,priority=900,prefix=,suffix=,pattern=,value=
463+
```
464+
419465
### `type=match`
420466

421467
```yaml
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
GITHUB_ACTION=crazy-maxghaction-dump-context
2+
GITHUB_ACTIONS=true
3+
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
4+
GITHUB_ACTOR=crazy-max
5+
GITHUB_API_URL=https://api.github.com
6+
GITHUB_BASE_REF=
7+
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_6ee180c2-b331-434a-a867-89534cbefd83
8+
GITHUB_EVENT_NAME=push
9+
#GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
10+
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
11+
GITHUB_HEAD_REF=
12+
GITHUB_JOB=event
13+
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_6ee180c2-b331-434a-a867-89534cbefd83
14+
GITHUB_REF=refs/tags/1.0dev4
15+
GITHUB_REPOSITORY=crazy-max/test-docker-action
16+
GITHUB_REPOSITORY_OWNER=crazy-max
17+
GITHUB_RETENTION_DAYS=90
18+
GITHUB_RUN_ID=325968230
19+
GITHUB_RUN_NUMBER=4
20+
GITHUB_SERVER_URL=https://github.com
21+
GITHUB_SHA=90dd6032fac8bda1b6c4436a2e65de27961ed071
22+
GITHUB_WORKFLOW=event
23+
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
GITHUB_ACTION=crazy-maxghaction-dump-context
2+
GITHUB_ACTIONS=true
3+
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
4+
GITHUB_ACTOR=crazy-max
5+
GITHUB_API_URL=https://api.github.com
6+
GITHUB_BASE_REF=
7+
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_6ee180c2-b331-434a-a867-89534cbefd83
8+
GITHUB_EVENT_NAME=push
9+
#GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
10+
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
11+
GITHUB_HEAD_REF=
12+
GITHUB_JOB=event
13+
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_6ee180c2-b331-434a-a867-89534cbefd83
14+
GITHUB_REF=refs/tags/1.1beta2
15+
GITHUB_REPOSITORY=crazy-max/test-docker-action
16+
GITHUB_REPOSITORY_OWNER=crazy-max
17+
GITHUB_RETENTION_DAYS=90
18+
GITHUB_RUN_ID=325968230
19+
GITHUB_RUN_NUMBER=4
20+
GITHUB_SERVER_URL=https://github.com
21+
GITHUB_SHA=90dd6032fac8bda1b6c4436a2e65de27961ed071
22+
GITHUB_WORKFLOW=event
23+
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
GITHUB_ACTION=crazy-maxghaction-dump-context
2+
GITHUB_ACTIONS=true
3+
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
4+
GITHUB_ACTOR=crazy-max
5+
GITHUB_API_URL=https://api.github.com
6+
GITHUB_BASE_REF=
7+
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_6ee180c2-b331-434a-a867-89534cbefd83
8+
GITHUB_EVENT_NAME=push
9+
#GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
10+
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
11+
GITHUB_HEAD_REF=
12+
GITHUB_JOB=event
13+
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_6ee180c2-b331-434a-a867-89534cbefd83
14+
GITHUB_REF=refs/tags/1.2.3rc2
15+
GITHUB_REPOSITORY=crazy-max/test-docker-action
16+
GITHUB_REPOSITORY_OWNER=crazy-max
17+
GITHUB_RETENTION_DAYS=90
18+
GITHUB_RUN_ID=325968230
19+
GITHUB_RUN_NUMBER=4
20+
GITHUB_SERVER_URL=https://github.com
21+
GITHUB_SHA=90dd6032fac8bda1b6c4436a2e65de27961ed071
22+
GITHUB_WORKFLOW=event
23+
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
GITHUB_ACTION=crazy-maxghaction-dump-context
2+
GITHUB_ACTIONS=true
3+
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
4+
GITHUB_ACTOR=crazy-max
5+
GITHUB_API_URL=https://api.github.com
6+
GITHUB_BASE_REF=
7+
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_6ee180c2-b331-434a-a867-89534cbefd83
8+
GITHUB_EVENT_NAME=push
9+
#GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
10+
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
11+
GITHUB_HEAD_REF=
12+
GITHUB_JOB=event
13+
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_6ee180c2-b331-434a-a867-89534cbefd83
14+
GITHUB_REF=refs/tags/1.2
15+
GITHUB_REPOSITORY=crazy-max/test-docker-action
16+
GITHUB_REPOSITORY_OWNER=crazy-max
17+
GITHUB_RETENTION_DAYS=90
18+
GITHUB_RUN_ID=325968230
19+
GITHUB_RUN_NUMBER=4
20+
GITHUB_SERVER_URL=https://github.com
21+
GITHUB_SHA=90dd6032fac8bda1b6c4436a2e65de27961ed071
22+
GITHUB_WORKFLOW=event
23+
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
GITHUB_ACTION=crazy-maxghaction-dump-context
2+
GITHUB_ACTIONS=true
3+
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
4+
GITHUB_ACTOR=crazy-max
5+
GITHUB_API_URL=https://api.github.com
6+
GITHUB_BASE_REF=
7+
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_6ee180c2-b331-434a-a867-89534cbefd83
8+
GITHUB_EVENT_NAME=push
9+
#GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
10+
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
11+
GITHUB_HEAD_REF=
12+
GITHUB_JOB=event
13+
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_6ee180c2-b331-434a-a867-89534cbefd83
14+
GITHUB_REF=refs/tags/1.2post1
15+
GITHUB_REPOSITORY=crazy-max/test-docker-action
16+
GITHUB_REPOSITORY_OWNER=crazy-max
17+
GITHUB_RETENTION_DAYS=90
18+
GITHUB_RUN_ID=325968230
19+
GITHUB_RUN_NUMBER=4
20+
GITHUB_SERVER_URL=https://github.com
21+
GITHUB_SHA=90dd6032fac8bda1b6c4436a2e65de27961ed071
22+
GITHUB_WORKFLOW=event
23+
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action

0 commit comments

Comments
 (0)