Merge pull request #450 from omise/release-v5.8.3 #49
Workflow file for this run
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: | |
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 }} |