Skip to content

Commit 0b9e30f

Browse files
Initial version
1 parent 5eacba9 commit 0b9e30f

File tree

7 files changed

+392
-1
lines changed

7 files changed

+392
-1
lines changed

.github/linters/.markdown-lint.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
###########################
2+
## Markdown Linter rules ##
3+
###########################
4+
5+
# Linter rules doc:
6+
# - https://github.com/DavidAnson/markdownlint
7+
8+
###############
9+
# Rules by id #
10+
###############
11+
MD004: false # Unordered list style
12+
MD007:
13+
indent: 2 # Unordered list indentation
14+
MD013:
15+
line_length: 808 # Line length
16+
MD026:
17+
punctuation: ".,;:!。,;:" # List of not allowed
18+
MD029: false # Ordered list item prefix
19+
MD033: false # Allow inline HTML
20+
MD036: false # Emphasis used instead of a heading
21+
22+
#################
23+
# Rules by tags #
24+
#################
25+
blank_lines: false # Error on blank lines

.github/release.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#configuring-automatically-generated-release-notes
2+
3+
changelog:
4+
categories:
5+
- title: Breaking Changes
6+
labels:
7+
- Major
8+
- Breaking
9+
- title: New Features
10+
labels:
11+
- Minor
12+
- Feature
13+
- Improvement
14+
- Enhancement
15+
- title: Other Changes
16+
labels:
17+
- '*'

.github/workflows/Auto-Release.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Auto-Release
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
types:
8+
- closed
9+
- opened
10+
- reopened
11+
- synchronize
12+
- labeled
13+
14+
concurrency:
15+
group: ${{ github.workflow }}
16+
17+
jobs:
18+
Auto-Release:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout Code
22+
uses: actions/checkout@v4
23+
24+
- name: Auto-Release
25+
uses: ./
26+
env:
27+
GH_TOKEN: ${{ github.token }} # Used for GitHub CLI authentication

.github/workflows/Linter.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Linter
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
Lint:
8+
name: Lint code base
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repo
12+
uses: actions/checkout@v4
13+
14+
- name: Lint code base
15+
uses: github/super-linter@latest
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## Ignore Visual Studio Code temporary files, build results, and
2+
## files generated by popular Visual Studio Code add-ons.
3+
##
4+
## Get latest from https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore
5+
.vscode/*
6+
!.vscode/settings.json
7+
!.vscode/extensions.json
8+
*.code-workspace
9+
10+
# Local History for Visual Studio Code
11+
.history/

README.md

+74-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,74 @@
1-
# Auto-Release
1+
# Auto-Release
2+
3+
Automatically creates releases based on pull requests and labels.
4+
5+
## Specifications and practices
6+
7+
Auto-Release follows:
8+
9+
- [SemVer 2.0.0 specifications](https://semver.org)
10+
- [GitHub Flow specifications](https://docs.github.com/en/get-started/using-github/github-flow)
11+
- [Continiuous Delivery practices](https://en.wikipedia.org/wiki/Continuous_delivery)
12+
13+
## Usage
14+
15+
The action have the following parameters:
16+
17+
| Parameter | Description | Default | Required |
18+
| --- | --- | --- | --- |
19+
| `AutoPatching` | Control wether to automatically handle patches. If disabled, the action will only create a patch release if the pull request has a 'patch' label. | `true` | false |
20+
| `IncrementalPrerelease` | Control wether to automatically increment the prerelease number. If disabled, the action will ensure only one prerelease exists for a given branch. | `true` | false |
21+
| `VersionPrefix` | The prefix to use for the version number. | `v` | false |
22+
23+
### Example
24+
Add a workflow in you repository using the following example:
25+
26+
```yaml
27+
name: Auto-Release
28+
29+
on:
30+
pull_request:
31+
branches:
32+
- main
33+
types:
34+
- closed
35+
- opened
36+
- reopened
37+
- synchronize
38+
- labeled
39+
40+
concurrency:
41+
group: ${{ github.workflow }}
42+
43+
jobs:
44+
Auto-Release:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Checkout Code
48+
uses: actions/checkout@v4
49+
50+
- name: Auto-Release
51+
uses: PSModule/Auto-Release@v1
52+
env:
53+
GH_TOKEN: ${{ github.token }} # Used for GitHub CLI authentication
54+
```
55+
56+
## How it works
57+
58+
The workflow will trigger on pull requests to the main branch.
59+
60+
The following labels will inform the action what kind of release to create:
61+
- For a major release, and increasing the first number in the version use:
62+
- `major`
63+
- `breaking`
64+
- For a minor release, and increasing the second number in the version.
65+
- `minor`
66+
- `feature`
67+
- `improvement`
68+
- `enhancement`
69+
- For a patch release, and increases the third number in the version.
70+
- `patch`
71+
- `bug`
72+
- `fix`
73+
74+
When a pull request is closed, the action will create a release based on the labels and clean up any previous prereleases that was created.

0 commit comments

Comments
 (0)