Release #62
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 main file | |
uses: jacobtomlinson/gha-find-replace@master | |
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@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' |