Skip to content

Commit

Permalink
chore(CI): Sorted CI
Browse files Browse the repository at this point in the history
  • Loading branch information
seebeen committed Sep 22, 2024
1 parent 002ad90 commit 63c922e
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ node_modules
.gitignore
.phpcs.xml
.prettierrc
.releaserc
.stylelintrc.js
CHANGELOG.md
DOCKER_ENV
Expand All @@ -28,4 +27,5 @@ composer.lock
output.log
package-lock.json
package.json
release.config.js
tsconfig.json
14 changes: 14 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,23 @@ on:
branches:
- master
- beta
paths:
- '.github/workflows/release.yml'
- 'assets/**/*'
- 'config/**/*'
- 'languages/**/*'
- 'lib/**/*'
- 'woocommerce/**/*'
- 'composer.*'
- 'package.json'
- 'package-lock.json'
- 'serbian-addons-for-woocommerce.php'

jobs:
ci:
name: CI
uses: ./.github/workflows/reusable_release.yml
secrets: inherit
with:
plugin_slug: 'serbian-addons-for-woocommerce'
dry_run: ${{ github.ref != 'refs/heads/master' }}
34 changes: 31 additions & 3 deletions .github/workflows/reusable_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Reusable Plugin Release and Publish
on:
workflow_call:
inputs:
dry_run:
description: 'Whether to run a dry run'
required: false
default: false
type: boolean
node_version:
description: 'Node version to use for building assets'
required: false
Expand All @@ -12,6 +17,10 @@ on:
required: false
default: true
type: boolean
plugin_slug:
description: 'Plugin slug'
required: true
type: string
composer_cmd_run:
description: 'Composer command to run'
required: false
Expand Down Expand Up @@ -64,9 +73,11 @@ jobs:
path: |
/tmp/composer-cache
dist
key: cache-${{ hashFiles('**/composer.lock') }}-${{ hashFiles('assets/**/*') }}
key: cache-${{ hashFiles('**/composer.lock') }}-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('assets/**/*') }}
restore-keys: |
cache-${{ hashFiles('**/composer.lock') }}-${{ hashFiles('**/package-lock.json') }}-
cache-${{ hashFiles('**/composer.lock') }}-
- name: Install Composer dependencies
uses: php-actions/composer@v6
env:
Expand All @@ -92,6 +103,7 @@ jobs:
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
with:
semantic_version: '22'
extra_plugins: |
@semantic-release/wordpress
env:
Expand Down Expand Up @@ -122,6 +134,22 @@ jobs:
shell: bash
run: |
echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
- name: Echo version
- name: Prepare files
shell: bash
run: echo ${{ steps.pkg.outputs.version }}
run: |
echo ${{ steps.pkg.outputs.version }}
mkdir assets
unzip -q assets.zip -d assets
unzip -q package.zip
- name: WordPress Plugin Deploy
id: deploy
uses: 10up/action-wordpress-plugin-deploy@2.2.2
env:
ASSETS_DIR: 'assets'
BUILD_DIR: ${{ inputs.plugin_slug }}
SVN_USERNAME: ${{ secrets.WP_ORG_SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.WP_ORG_SVN_PASSWORD }}
VERSION: ${{ steps.pkg.outputs.version }}
with:
generate-zip: false
dry-run: ${{ inputs.dry_run }}
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
},
"require-dev": {
"oblak/wordpress-coding-standard": "^1.1.1",
"php-stubs/woocommerce-stubs": "^9.3",
"symfony/var-dumper": "^5.4"
},
"autoload": {
Expand Down
94 changes: 93 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 63c922e

Please sign in to comment.