Skip to content

Commit

Permalink
Merge pull request #4 from OpenWebconcept/feat/updater
Browse files Browse the repository at this point in the history
Release updater
  • Loading branch information
sanderdekroon authored Jun 28, 2023
2 parents 634750c + bef872d commit 2ec4a1a
Show file tree
Hide file tree
Showing 9 changed files with 382 additions and 177 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release

on:
push:
tags:
- '*'

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: php-actions/composer@v6
with:
# Lowest supported PHP version
php_version: "7.4"
- run: composer run package
- name: Release
uses: fnkr/github-action-ghr@v1
env:
GHR_COMPRESS: zip
GHR_PATH: releases/
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

# track this file .gitignore (i.e. do NOT ignore it)
!.gitignore
!.github/

# Eslint
!.eslintrc
Expand Down Expand Up @@ -94,6 +95,7 @@ bower_components
*.map

vendor
releases
!/src/vendor

tests/coverage
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## Version 2.1.0

### Features

- Updates can now be provided through the Admin interface

## Version 2.0.9

### Chore
Expand Down
29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
# README #
# README

This README documents whatever steps are necessary to get this plugin up and running.

### How do I get set up? ###
## Getting started
### Installation

* Unzip and/or move all files to the /wp-content/plugins/pdc-samenwerkende-catalogi directory
* Log into WordPress admin and activate the ‘PDC Samenwerkende Catalogi’ plugin through the ‘Plugins’ menu
* Go to the 'PDC instellingen pagina' in the left-hand menu to enter some of the required settings
#### For users
1. Download the latest release from [the releases page](https://github.com/OpenWebconcept/plugin-pdc-faq/releases)
2. Unzip and move all files to the `/wp-content/plugins/pdc-samenwerkende-catalogi` directory.
3. Log into the WordPress admin and activate the 'PDC Samenwerkende Catalogi' plugin through the 'plugins' menu
4. Go to the 'PDC instellingen pagina' in the left-hand menu to enter some of the required settings

#### For developers
To contribute to this project, no dependencies are required. However, you will need to download [Composer](https://getcomposer.org/) to run tests or create an optimized build of the plugin.

1. Clone this repository to your machine and/or WordPress installation
2. Optionally use Composer (`composer install`) to install the dev dependencies

To create an optimized and zipped build, run the `composer run package` command. This requires `Composer`, `rsync` and `zip` to run.

### Filters & Actions

Expand All @@ -22,7 +33,7 @@ See OWC\PDC\Base\Foundation\Config->set method for a way to change this plugins
Via the plugin object the following config settings can be adjusted
- settings

### Translations ###
### Translations

If you want to use your own set of labels/names/descriptions and so on you can do so.
All text output in this plugin is controlled via the gettext methods.
Expand All @@ -39,7 +50,7 @@ This plugin provides an easy interface for custom translations and a way to stor
For instructions how to use the 'Loco Translate' plugin, we advice you to read the Beginners's guide page on their website: https://localise.biz/wordpress/plugin/beginners
or start at the homepage: https://localise.biz/wordpress/plugin

### Running tests ###
### Running tests
To run the Unit tests go to a command-line.
```bash
cd /path/to/wordpress/htdocs/wp-content/plugins/pdc-samenwerkende-catalogi/
Expand All @@ -52,12 +63,12 @@ For code coverage report, generate report with command line command and view res
composer unit-coverage
```

### Contribution guidelines ###
### Contribution guidelines

##### Writing tests
Have a look at the code coverage reports to see where more coverage can be obtained.
Write tests.
Create a Pull request to the OWC repository.

### Who do I talk to? ###
### Who do I talk to?
If you have questions about or suggestions for this plugin, please contact <a href="mailto:[email protected]">Holger Peters</a> from Gemeente Buren.
31 changes: 31 additions & 0 deletions bin/package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

## Remove old packages
rm -rf ./releases
mkdir -p ./releases

# Copy current dir to tmp
rsync \
-ua \
--exclude='vendor/*' \
--exclude='releases/*' \
./ ./releases/pdc-samenwerkende-catalogi/

# Remove current vendor folder (if any)
# and install the dependencies without dev packages.
cd ./releases/pdc-samenwerkende-catalogi || exit
composer install -o --no-dev

# Remove unneeded files in a WordPress plugin
rm -rf ./.git ./composer.json ./.gitignore ./.editorconfig ./.eslintignore \
./.eslintrc ./.php-cs-fixer.php ./composer.lock ./bin \
./phpstan.neon.dist ./phpunit.xml.dist ./tests \
./DOCKER_ENV ./docker_tag ./output.log ./.github

cd ../

# Create a zip file from the optimized plugin folder
zip -rq pdc-samenwerkende-catalogi.zip ./pdc-samenwerkende-catalogi
rm -rf ./pdc-samenwerkende-catalogi

echo "Zip completed @ $(pwd)/pdc-samenwerkende-catalogi.zip"
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
],
"type": "wordpress-plugin",
"require": {
"php": "^7.4|^8.0"
"php": "^7.4|^8.0",
"yahnis-elsts/plugin-update-checker": "^5.1"
},
"require-dev": {
"mockery/mockery": "*",
Expand All @@ -36,6 +37,7 @@
"@unit",
"@integration"
],
"format": "vendor/bin/php-cs-fixer fix"
"format": "vendor/bin/php-cs-fixer fix",
"package": "chmod +x ./bin/package.sh && ./bin/package.sh"
}
}
Loading

0 comments on commit 2ec4a1a

Please sign in to comment.