-
Notifications
You must be signed in to change notification settings - Fork 6
58 lines (54 loc) · 2.16 KB
/
master-changelog_manager.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: m2-master-changelog-manager
on:
push:
pull_request:
branches:
- master
jobs:
create-release:
if: (contains( github.event.head_commit.message, 'major release') || contains( github.event.head_commit.message,'minor release') || contains( github.event.head_commit.message, 'patch release'))
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: setup python
uses: actions/setup-python@v4
with:
pthon-version: '3.9'
- name: update major version file
if: contains( github.event.head_commit.message, 'Major Release')
run: python ./.github/version_update.py 0 "${{github.event.head_commit.message}}"
- name: update minor version file
if: contains( github.event.head_commit.message, 'Minor Release')
run: python ./.github/version_update.py 1 "${{github.event.head_commit.message}}"
- name: update patch version file
if: contains( github.event.head_commit.message, 'Patch Release')
run: python ./.github/version_update.py 2 "${{github.event.head_commit.message}}"
- name: Set Tag Output
id: set-tag
run: echo "::set-output name=tag_name::$(sh ./.github/get-version.sh)"
- name: Push release files
id: push-release-file
run: |
git config --global user.name 'martin-liriano'
git config --global user.email "martin.liriano@extend.com"
git add ./.github/version.txt ./etc/config.xml changelog.md composer.json ./.github/branch_changelog.md
git commit -m "version update deployment ${{ steps.set-tag.outputs.tag_name }}"
git push
git fetch
- name: Create tag
id: create-tag
uses: actions/github-script@v6
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ steps.set-tag.outputs.tag_name }}",
sha: context.sha
})
- name: Create release
id: set-release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.set-tag.outputs.tag_name }}