-
Notifications
You must be signed in to change notification settings - Fork 27
61 lines (57 loc) · 1.72 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
name: Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+'
- 'v[0-9]+'
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Validate composer.json and composer.lock
run: composer validate
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest
- name: Run test suite
run: vendor/bin/phpunit
validate:
name: Validate
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.release-version.outputs.tag }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get release version
id: release-version
run: echo ::set-output name=tag::$(echo $GITHUB_REF | cut -c 12-)
- name: Validate versioning
run: find omise-woocommerce.php -type f | xargs grep -n "version = '${{ steps.release-version.outputs.tag }}'"
release:
name: Release
runs-on: ubuntu-latest
needs: [build, validate]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: WordPress Plugin Deploy
id: deploy
uses: 10up/action-wordpress-plugin-deploy@stable
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SLUG: omise # https://plugins.svn.wordpress.org/omise/
VERSION: ${{ needs.validate.outputs.tag }}