Skip to content

Update version tags to 10.0.0-alpha12 #786

Update version tags to 10.0.0-alpha12

Update version tags to 10.0.0-alpha12 #786

Workflow file for this run

name: test-deploy
on: [push, pull_request]
jobs:
beta:
if: >
startsWith(github.ref, 'refs/tags')
|| contains(github.event.head_commit.message, '[ci]')
runs-on: ubuntu-latest
outputs:
ver: ${{ steps.get.outputs.ver }}
steps:
- id: get
name: Get latest WP beta version
run: php --run "echo 'ver=' . json_decode( file_get_contents( 'https://api.wordpress.org/core/version-check/1.7/?version=6.4&channel=beta' ) )->offers[0]->version;" >> "$GITHUB_OUTPUT"
test:
needs: beta
name: PHP Unit tests
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
php: [ '7.4', '8.0', '8.1', '8.2', '8.3' ] # https://www.php.net/supported-versions
wordpress: [ '6.2', "${{ needs.beta.outputs.ver }}" ] # https://wordpress.org/download/releases/
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: dbpass
MYSQL_DATABASE: dbname
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout Websites
uses: actions/checkout@v4
with:
repository: nextgenthemes/websites
ref: master
sparse-checkout: |
.
bin
path: .
token: ${{ secrets.REPO_TOKEN }}
- name: rm composer.json
run: rm composer.json
- name: Checkout ARVE
uses: actions/checkout@v4
with:
repository: nextgenthemes/advanced-responsive-video-embedder
path: symbiosistheme.com/web/app/plugins/advanced-responsive-video-embedder
token: ${{ secrets.REPO_TOKEN }}
- name: Checkout ARVE Pro
uses: actions/checkout@v4
with:
repository: nextgenthemes/arve-pro
ref: master
path: symbiosistheme.com/web/app/plugins/arve-pro
token: ${{ secrets.REPO_TOKEN }}
- name: Checkout ARVE Random Video
uses: actions/checkout@v4
with:
repository: nextgenthemes/arve-random-video
ref: master
path: symbiosistheme.com/web/app/plugins/arve-random-video
token: ${{ secrets.REPO_TOKEN }}
- name: Checkout ARVE AMP
uses: actions/checkout@v4
with:
repository: nextgenthemes/arve-amp
ref: master
path: symbiosistheme.com/web/app/plugins/arve-amp
token: ${{ secrets.REPO_TOKEN }}
- name: Checkout ARVE Sticky Videos
uses: actions/checkout@v4
with:
repository: nextgenthemes/arve-sticky-videos
ref: master
path: symbiosistheme.com/web/app/plugins/arve-sticky-videos
token: ${{ secrets.REPO_TOKEN }}
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@7fdd3ece872ec7ec4c098ae5ab7637d5e0a96067 # 2.26.0 # https://github.com/shivammathur/setup-php/releases/
with:
php-version: ${{ matrix.php }}
ini-values: zend.assertions=1, error_reporting=-1, display_errors=On
extensions: mbstring, dom, zip, mysql, gd
tools: phpunit-polyfills:1
coverage: none #optional
- name: Start mysql service
run: sudo /etc/init.d/mysql start
- name: Install WP Tests
run: bash ./bin/install-wp-tests.sh dbname root dbpass "127.0.0.1:$DB_PORT" ${{ matrix.wordpress }} true
env:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
- name: Run PHPUnit without code coverage
run: phpunit --testsuite advanced-responsive-video-embedder,arve-pro,arve-random-video,arve-amp,arve-sticky-videos
deploy-wporg:
needs: test
if: >
startsWith(github.ref, 'refs/tags') &&
(!contains(github.ref, 'alpha') && !contains(github.ref, 'beta') && !contains(github.ref, 'dev'))
name: SVN commit to wp.org
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: advanced-responsive-video-embedder
- if: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'dev') }}
name: Deploy to WP.org
uses: nextgenthemes/action-wordpress-plugin-deploy@master
with:
workdir: advanced-responsive-video-embedder
version: ${{github.ref_name}}
svn_user: ${{ secrets.SVN_USERNAME }}
svn_pass: ${{ secrets.SVN_PASSWORD }}
verbose: true
dry-run: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'dev') }}
deploy-github:
needs: test
if: startsWith(github.ref, 'refs/tags')
name: Upload Release Asset
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
- name: git archive .zip
run: git archive -o /tmp/advanced-responsive-video-embedder-${{ github.ref_name }}.zip --prefix=advanced-responsive-video-embedder/ ${{ github.ref_name }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: ${{ github.ref_name }}
draft: false
prerelease: false # not doing this (for now) because this will as easy to grab with GitHub API and the realease API repsonse can apprently out of order so its hard to grab the latest pro-release from it. https://github.com/orgs/community/discussions/8226#discussioncomment-7704448
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /tmp/advanced-responsive-video-embedder-${{ github.ref_name }}.zip
asset_name: advanced-responsive-video-embedder-${{ github.ref_name }}.zip
asset_content_type: application/zip
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /tmp/advanced-responsive-video-embedder-${{ github.ref_name }}.zip
asset_name: arve.zip
asset_content_type: application/zip