Skip to content

Refactor Trigger class with stricter typing and bug fixes #5

Refactor Trigger class with stricter typing and bug fixes

Refactor Trigger class with stricter typing and bug fixes #5

Workflow file for this run

name: CI
on:
push:
tags:
- '*'
jobs:
call-install-deps:
if: github.repository != 'JUVOJustin/wordpress-plugin-boilerplate' # This line is save to be deleted. It's only here to prevent the workflow from running on the boilerplate repository.
uses: ./.github/workflows/install-deps.yml
with:
mode: 'prod'
secrets: inherit
build:
if: github.repository != 'JUVOJustin/wordpress-plugin-boilerplate' # This line is save to be deleted. It's only here to prevent the workflow from running on the boilerplate repository.
runs-on: ubuntu-latest
needs: call-install-deps
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-node@v2.1.4
- name: Load Cache
uses: actions/cache@v4
with:
path: |
vendor
key: deps-prod-${{ hashFiles('composer.lock') }}
fail-on-cache-miss: true
id: cache
- name: Clean up development files (Prod)
run: |
find . -name "composer.json" -type f -delete && find . -name "composer.lock" -type f -delete
find . -name "package.json" -type f -delete && find . -name "package-lock.json" -type f -delete
find . -name "constants.php" && find . -name "README.md"
rm -rf .git && find . -name ".gitignore" -type f -delete
rm -rf .github
rm -rf tests
rm -rf bin
shell: bash
# Update Version
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Update Version in WordPress files
run: |
sed -i -E 's/([[:blank:]]*\*[[:blank:]]*Version:[[:blank:]]*).*/\1${{ env.RELEASE_VERSION }}/' ${{ github.event.repository.name }}.php
sed -i -E 's/([[:blank:]]*\$version[[:blank:]]*=[[:blank:]]*")(.*)(".*)/\1${{ env.RELEASE_VERSION }}\3/' ${{ github.event.repository.name }}.php
sed -i -E 's/Stable tag: .*/Stable tag: ${{ env.RELEASE_VERSION }}/' readme.txt
- name: Update resources
uses: test-room-7/action-update-file@v1
with:
file-path: |
${{ github.event.repository.name }}.php
readme.txt
commit-msg: Update Version in WordPress specific files
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@stable
env:
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SLUG: juvo-mail-editor
# Zip everything
- shell: bash
run: |
cd ..
sudo apt-get install zip
zip -r ${{ github.event.repository.name }}-${{ env.RELEASE_VERSION }}.zip ./*
- name: Release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
omitBodyDuringUpdate: true
artifacts: "../${{ github.event.repository.name }}-${{ env.RELEASE_VERSION }}.zip"