-
Notifications
You must be signed in to change notification settings - Fork 33
71 lines (69 loc) · 2.66 KB
/
release.yml
File metadata and controls
71 lines (69 loc) · 2.66 KB
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
71
name: Release
on:
workflow_dispatch:
inputs:
new_version:
description: 'New version'
required: true
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: 'develop'
fetch-depth: 0
persist-credentials: false
- name: Fetch master branch
run: git fetch origin master:master
- 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@v3
with:
find: "(?i)\\[Next\\]"
replace: "${{ github.event.inputs.new_version }}"
- name: Replace stable tag in readme
uses: jacobtomlinson/gha-find-replace@v3
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@v3
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 main file
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "'NOTIFICATION_VERSION', '[0-9]+.[0-9]+.[0-9]+'"
replace: "'NOTIFICATION_VERSION', '${{ github.event.inputs.new_version }}'"
include: "${{ secrets.SLUG }}.php"
- name: Replace constant tag in Runtime file
uses: jacobtomlinson/gha-find-replace@v3
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" --allow-empty
- name: Finish release
run: git flow release finish ${{ github.event.inputs.new_version }} -m "v${{ github.event.inputs.new_version }}"
- name: Push master, develop, and tags
run: |
REMOTE="https://x-access-token:${{ secrets.WORKER_TOKEN }}@github.com/${{ github.repository }}.git"
git push "$REMOTE" master
git push "$REMOTE" develop
git push "$REMOTE" --tags