-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
59 lines (51 loc) · 1.59 KB
/
action.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
name: Release WP Plugin
description: Bump version string in package files and creates a release.
inputs:
php-version:
description: PHP Version
default: 7.4
required: false
node-version:
description: Node Version
default: 16.13.2
required: false
runs:
using: composite
steps:
- uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
- name: Setup PHP with composer v2.
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.php-version }}
tools: composer:v2
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.x'
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0
with:
useConfigFile: true
- name: Update package file versions
run: |
php -r '
include "${{ github.action_path }}/php/PackageVersionManager.php";
$packageVersionManager = new PackageVersionManager("${{ steps.gitversion.outputs.semVer }}");
$packageVersionManager->updatePackageFiles();
'
shell: bash
- name: Commit package file versions
run: |
git config --local user.email ""
git config --local user.name "GitHub Action"
git add .
git commit -m "build: update package file versions to ${{ steps.gitversion.outputs.semVer }}"
git push
shell: bash
- uses: ncipollo/release-action@v1
with:
generateReleaseNotes: true
tag: ${{ steps.gitversion.outputs.semVer }}