-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (68 loc) · 2.41 KB
/
release.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
59
60
61
62
63
64
65
66
67
68
69
70
name: Release
on:
workflow_dispatch:
inputs:
new_version:
description: 'New version'
required: true
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout master
uses: actions/checkout@v1
with:
ref: 'master'
- name: Checkout develop
uses: actions/checkout@v1
with:
ref: 'develop'
clean: false
- name: Install git-flow
run: sudo apt-get install git-flow -y
- name: Configure commiter
run: |
git config --local user.email "${{ secrets.WORKER_EMAIL }}"
git config --local user.name "${{ secrets.WORKER_NAME }}"
- name: Init git-flow
run: git flow init -d
- name: Start release
run: git flow release start ${{ github.event.inputs.new_version }}
- name: Replace Next tags with new version number
uses: jacobtomlinson/gha-find-replace@master
with:
find: "(?i)\\[Next\\]"
replace: "${{ github.event.inputs.new_version }}"
- name: Replace stable tag in readme
uses: jacobtomlinson/gha-find-replace@master
with:
find: "Stable tag: [0-9]+.[0-9]+.[0-9]+"
replace: "Stable tag: ${{ github.event.inputs.new_version }}"
include: "readme.txt"
- name: Replace version tag in main file
uses: jacobtomlinson/gha-find-replace@master
with:
find: "Version: [0-9]+.[0-9]+.[0-9]+"
replace: "Version: ${{ github.event.inputs.new_version }}"
include: "${{ secrets.SLUG }}.php"
- name: Replace constant tag in Runtime file
uses: jacobtomlinson/gha-find-replace@master
with:
find: "VERSION = '[0-9]+.[0-9]+.[0-9]+'"
replace: "VERSION = '${{ github.event.inputs.new_version }}'"
include: "src/classes/Runtime.php"
- name: Commit version bump
run: git commit -am "Version bump"
- name: Finish release
run: git flow release finish ${{ github.event.inputs.new_version }} -m "v${{ github.event.inputs.new_version }}"
- name: Push develop and tags
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.WORKER_TOKEN }}
branch: 'develop'
- name: Push master
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.WORKER_TOKEN }}
branch: 'master'