Skip to content

Commit

Permalink
Merge pull request #1523 from xwp/release/4.0.1
Browse files Browse the repository at this point in the history
Release `4.0.1`
  • Loading branch information
delawski authored Jul 30, 2024
2 parents 0336294 + 445175b commit abc53ab
Show file tree
Hide file tree
Showing 202 changed files with 10,737 additions and 15,076 deletions.
24 changes: 24 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.coveralls.yml
.distignore
.editorconfig
.eslintignore
.eslintrc.json
.gitignore
.nvmrc
composer.lock
docker-compose.build.yml
docker-compose.yml
Gruntfile.js
package.json
package-lock.json
phpcs.xml.dist
phpunit.xml
phpunit-multisite.xml
renovate.json
.git
.github
.vscode
.wordpress-org
local
node_modules
tests
33 changes: 27 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ jobs:
lint:
name: Lint and Test
runs-on: ubuntu-22.04
permissions:
contents: read
packages: read
steps:

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
Expand All @@ -24,6 +27,24 @@ jobs:
php-version: '8.1'
tools: composer:v2

- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache Composer packages
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ hashFiles( 'composer.lock' ) }}
restore-keys: ${{ runner.os }}-php-

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Install NPM dependencies
run: npm install

Expand All @@ -33,11 +54,11 @@ jobs:
- name: Lint
run: npm run lint

- name: Pull Docker Images
run: docker-compose pull wordpress
- name: Pull custom Docker images
run: docker compose pull wordpress

- name: Test PHP
run: npm run phpunit
- name: Test
run: npm run test

- name: Build
run: npm run build
95 changes: 95 additions & 0 deletions .github/workflows/deploy-to-wp-org.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Deploy to WordPress.org Repository

on:

# The action will run when a release or a pre-release is created.
#
# In case of a pre-release, the action will not commit to WP.org (dry-run). However, it will still
# create a zip file and upload it to the release. Note that a pre-release (release candidate)
# should not be changed to a release but rather a new release should be created.
release:
types:
- released
- prereleased

jobs:

deploy_to_wp_repository:
name: Deploy to WP.org
runs-on: ubuntu-22.04
permissions:
contents: write
packages: read

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: composer:v2

- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache Composer packages
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ hashFiles( 'composer.lock' ) }}
restore-keys: ${{ runner.os }}-php-

# Install dependencies.
- name: Install NPM dependencies
run: npm install

- name: Install Composer dependencies
run: composer install --no-dev

# Build.
- name: Build
run: npm run build

- name: WordPress Plugin Deploy
# This is used to get the zip-path later.
id: deploy
uses: 10up/action-wordpress-plugin-deploy@stable
with:
generate-zip: true
# In case of a pre-release, do not commit to WP.org.
dry-run: ${{ github.event.release.prerelease }}

# Use secrets to authenticate with WP.org.
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}

# After the deployment, we also want to create a zip and upload it to the release on GitHub.
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
# Note, this is an exception to action secrets: GITHUB_TOKEN is always available and provides access to
# the current repository this action runs in.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

with:
# Get the URL for uploading assets to the current release.
upload_url: ${{ github.event.release.upload_url }}

# Provide the path to the file generated in the previous step using the output.
asset_path: ${{ steps.deploy.outputs.zip-path }}

# Provide what the file should be named when attached to the release (plugin-name.zip)
asset_name: ${{ github.event.repository.name }}.zip

# Provide the file type.
asset_content_type: application/zip
40 changes: 40 additions & 0 deletions .github/workflows/docker-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build and Publish Docker Images

on:
push:
paths:
- '.github/workflows/docker-images.yml'
- 'docker-compose.yml'
- 'docker-compose.build.yml'
- 'local/docker/**'

jobs:

build-and-push-image:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build images
run: docker compose --file docker-compose.build.yml build

- name: Publish images
if: contains( github.ref_name, 'master' )
run: docker buildx bake --file docker-compose.build.yml --push --set '*.platform=linux/amd64,linux/arm64'
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,19 @@
/vendor/
/build/
/dist/
/.vagrant/
/console.log
/phpcs.xml
/stream.zip
/stream-*.zip
npm-debug.log
debug.log
package.lock
.phpunit.result.cache

# Compiled files
ui/js/*.min.js
ui/css/*.min.css
alerts/js/*.min.js

# Generated test data
tests/data/tmp/*
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
20
93 changes: 0 additions & 93 deletions .travis.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
"name": "Listen for Stream XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"port": 9003,
"ignore": [
"vendor/"
],
"pathMappings": {
"/var/www/html/wp-content/plugins/stream-src": "${workspaceRoot}",
"/var/www/html/wp-content/plugins/stream": "${workspaceRoot}/build",
"/var/www/html": "${workspaceRoot}/local/public"
"/var/www/html/wp-content/plugins/stream-src": "${workspaceFolder}",
"/var/www/html/wp-content/plugins/stream": "${workspaceFolder}/build",
"/var/www/html": "${workspaceFolder}/local/public"
}
}
]
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Loading

0 comments on commit abc53ab

Please sign in to comment.