Skip to content

Commit e7a8a6d

Browse files
Merge pull request #1 from codenamephp/main
Initial Release
2 parents 5458486 + d65f548 commit e7a8a6d

8 files changed

Lines changed: 109 additions & 87 deletions

File tree

.github/release-drafter.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,4 @@ template: |
33
$CHANGES
44
exclude-labels:
55
- "skip-changelog"
6-
- "invalid"
7-
version-resolver:
8-
major:
9-
labels:
10-
- 'semver:major'
11-
- 'Breaking Change'
12-
minor:
13-
labels:
14-
- 'semver:minor'
15-
- 'enhancement'
16-
- 'Deprecation'
17-
patch:
18-
labels:
19-
- 'semver:patch'
20-
- 'bug'
21-
default: patch
6+
- "invalid"

.github/version-drafter.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
major-labels: [ 'semver:major', 'Breaking Change' ]
2+
minor-labels: [ 'semver:minor','enhancement', 'Deprecation' ]
3+
patch-labels: [ 'semver:patch','bug' ]

.github/workflows/draft-release.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/post-release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Post Release
2+
on:
3+
release:
4+
types: [ published ]
5+
6+
jobs:
7+
update_default_branch:
8+
name: Update default branch after published release
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
with:
14+
ref: "main"
15+
16+
- name: create changelog
17+
uses: charmixer/auto-changelog-action@v1
18+
with:
19+
token: ${{ secrets.GITHUB_TOKEN }}
20+
exclude_labels: "duplicate,question,invalid,wontfix,skip-changelog"
21+
22+
- name: commit updated changelog
23+
uses: EndBug/[email protected]
24+
with:
25+
message: "[CHANGELOG] Updated changelog"
26+
add: "CHANGELOG.md"
27+
signoff: true
28+
branch: main
29+
token: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Create pull request
32+
uses: repo-sync/pull-request@v2
33+
with:
34+
source_branch: "release"
35+
destination_branch: "main"
36+
pr_title: "[Deployment] Update default branch"
37+
pr_label: "skip-changelog"
38+
github_token: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Prepare Release
2+
on:
3+
push:
4+
branches: [ release ]
5+
paths-ignore:
6+
- '**.md'
7+
8+
jobs:
9+
calculate_next_version:
10+
name: Calculate next release version
11+
runs-on: ubuntu-latest
12+
outputs:
13+
version: ${{ steps.version.outputs.next-version }}
14+
steps:
15+
- name: calculate next version
16+
id: version
17+
uses: patrickjahns/version-drafter-action@v1
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
21+
draft_release:
22+
name: Create draft release
23+
runs-on: ubuntu-latest
24+
needs: calculate_next_version
25+
steps:
26+
- name: draft release
27+
uses: release-drafter/release-drafter@v5
28+
with:
29+
version: ${{ format('{0}', needs.calculate_next_version.outputs.version) }}
30+
tag: ${{ format('{0}', needs.calculate_next_version.outputs.version) }}
31+
name: ${{ format('{0}', needs.calculate_next_version.outputs.version) }}
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
35+
update_changelog:
36+
name: Update changelog
37+
runs-on: ubuntu-latest
38+
needs: calculate_next_version
39+
steps:
40+
- name: checkout
41+
uses: actions/checkout@v2
42+
43+
- name: create changelog
44+
uses: charmixer/[email protected]
45+
with:
46+
token: ${{ secrets.GITHUB_TOKEN }}
47+
exclude_labels: "duplicate,question,invalid,wontfix,skip-changelog"
48+
future_release: ${{ format('{0}', needs.calculate_next_version.outputs.version) }}
49+
release_branch: 'release'
50+
51+
- name: commit updated changelog
52+
uses: EndBug/[email protected]
53+
with:
54+
message: "[CHANGELOG] Updated changelog"
55+
add: "CHANGELOG.md"
56+
signoff: true
57+
token: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
name: Update Changelog
22
on:
33
push:
4-
branches: [ master ]
4+
branches: [ main ]
55
paths-ignore:
6-
- '**.md'
7-
release:
8-
types: [ published ]
6+
- "**.md"
97

108
jobs:
119
update_changelog:
1210
name: Update changelog
1311
runs-on: ubuntu-latest
14-
if: github.event_name != 'release'
1512
steps:
1613
- name: Checkout
1714
uses: actions/checkout@v2
@@ -23,36 +20,9 @@ jobs:
2320
exclude_labels: "duplicate,question,invalid,wontfix,skip-changelog"
2421

2522
- name: commit updated changelog
26-
uses: EndBug/add-and-commit@v6
23+
uses: EndBug/add-and-commit@v6.2.0
2724
with:
2825
message: "[CHANGELOG] Updated changelog"
2926
add: "CHANGELOG.md"
3027
signoff: true
31-
env:
32-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33-
34-
update_changelog_after_release:
35-
name: Update changelog in default branch after published release
36-
runs-on: ubuntu-latest
37-
if: github.event_name == 'release'
38-
steps:
39-
- name: Checkout
40-
uses: actions/checkout@v2
41-
with:
42-
ref: 'main'
43-
44-
- name: create changelog
45-
uses: charmixer/auto-changelog-action@v1
46-
with:
47-
token: ${{ secrets.GITHUB_TOKEN }}
48-
exclude_labels: "duplicate,question,invalid,wontfix,skip-changelog"
49-
50-
- name: commit updated changelog
51-
uses: EndBug/add-and-commit@v6
52-
with:
53-
message: "[CHANGELOG] Updated changelog"
54-
add: "CHANGELOG.md"
55-
signoff: true
56-
branch: main
57-
env:
58-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/.cache/*
22
/.logs/*
33
/test/.phpunit.result.cache
4+
!/**/.gitkeep
45

56
# Created by https://www.toptal.com/developers/gitignore/api/composer,phpstorm
67
# Edit at https://www.toptal.com/developers/gitignore?templates=composer,phpstorm

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
4+
5+
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*

0 commit comments

Comments
 (0)