Skip to content

Commit

Permalink
Merge pull request #49 from threadi/feature/addGitHubActionForRelease
Browse files Browse the repository at this point in the history
added GitHub action for Release (solves #48)
  • Loading branch information
threadi authored Dec 21, 2024
2 parents d558d34 + 87aaeae commit acadcd3
Show file tree
Hide file tree
Showing 6 changed files with 183 additions and 46 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/build-zip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build release zip

on:
push:
tags:
- '*'

jobs:
build:
name: Build release zip
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Run package installs and builds
run: |
composer install
composer update
npm i
npm run build
- name: Run WordPress Coding Standard fixes
run: vendor/bin/phpcbf --extensions=php --ignore=*/vendor/*,*/attributes/*,*/node_modules/*,*/svn/*,*/releases/* --standard=ruleset.xml .

- name: Run WordPress Coding Standard checks
run: vendor/bin/phpcs --extensions=php --ignore=*/vendor/*,*/attributes/*,*/node_modules/*,*/svn/*,*/releases/* --standard=ruleset.xml .

- name: Set version number
uses: richardrigutins/replace-in-files@v2
with:
files: 'play-audio-once.php'
search-text: '@@VersionNumber@@'
replacement-text: ${{ github.ref_name }}

- name: Set version number 2
uses: richardrigutins/replace-in-files@v2
with:
files: 'readme.txt'
search-text: '@@VersionNumber@@'
replacement-text: ${{ github.ref_name }}

- name: ZIP plugin
run: |
rm -fr assets
rm -fr build
rm changelog.md
rm package.json
rm package-lock.json
rm ruleset.xml
cd ..
zip -r -q ${{ github.event.repository.name }}_${{ github.ref_name }}.zip ${{ github.event.repository.name }}/* -x "*/.git/*" "*/.github/*" "*/phpcs.xml" "*/composer.json" "*/composer.lock" "*/readme.md" "*/.gitignore" "*/vendor/*" "*/node_modules/*" "*/svn/*" "*/releases/*"
cp ${{ github.event.repository.name }}_${{ github.ref_name }}.zip ${{ github.event.repository.name }}/
- name: Create Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ${{ github.event.repository.name }}_${{ github.ref_name }}.zip
96 changes: 96 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Changelog

## [1.1.6] - 21.12.2024

### Added

- Added GitHub action for releases

### Changed

- Moved changelog to GitHub

## [1.1.5] - 06.11.2024

### Changed

- Updated compatibility-flag for WordPress 6.7
- Updated dependencies (security fixes in them)

## [1.1.4] - 16.03.2024

### Changed

- Updated compatibility-flag for WordPress 6.5
- Updated dependencies (security fixes in them)

## [1.1.3] - 26.11.2023

### Changed

- Cleaned js-files
- Updated dependencies (security fixes in them)
## [1.1.2] - 21.10.2023

### Changed

- Updated compatibility-flag for WordPress 6.4
- Updated dependencies
- Compatible with WordPress Coding Standards 3.0

### Removed

- Removed language files from release

## [1.1.1] - 16.07.2023

### Changed

- Optimized translation-handling during plugin-build
- Compatible with WordPress Coding Standards
- Updated compatibility-flag for WordPress 6.3
- Updated dependencies

## [1.1.0] - 19.03.2023

### Added

- Added translations for german (formal), spanisch and italian

### Changed

- Updated compatibility-flag for WordPress 6.2
- Updated dependencies
- Cleanup repository

### Fixed

- Fixed setting of default value for our plugin-option

## [1.0.3] - 16.07.2022

### Added

- Added build-system in repository

### Changed

- Updated compatibility-flag for WordPress 6.0.1

## [1.0.2] - 21.05.2022

### Changed

- Updated compatibility-flag for WordPress 6.0

## [1.0.1] - 15.04.2022

### Changed

- Updated dependencies

## [1.0.0] - 02.03.2022

### Added

- Initial commit
2 changes: 1 addition & 1 deletion play-audio-once.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function play_audio_once_assets(): void {
wp_set_script_translations(
'play-audio-once-backend-js',
'play-audio-once',
trailingslashit(plugin_dir_path( __FILE__ )) . 'languages/'
trailingslashit( plugin_dir_path( __FILE__ ) ) . 'languages/'
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ Hint: will be called by ant-command mentioned above.

### Run

`vendor/bin/phpcs --standard=WordPress file`
`vendor/bin/phpcs --extensions=php --ignore=*/vendor/*,*/attributes/*,*/node_modules/*,*/svn/*,*/releases/* --standard=ruleset.xml .`

### Repair

`vendor/bin/phpcbf --standard=WordPress file`
`vendor/bin/phpcbf --extensions=php --ignore=*/vendor/*,*/attributes/*,*/node_modules/*,*/svn/*,*/releases/* --standard=ruleset.xml .`
48 changes: 5 additions & 43 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Tested up to: 6.7
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Stable tag: 1.1.5
Stable tag: @@VersionNumber@@

Adds an option to the audio block in Gutenberg-editor to prevent the file from being played multiple times.

Expand All @@ -30,46 +30,8 @@ The source-code of this plugin is hosted on [GitHub](https://github.com/threadi/

== Changelog ==

= 1.0.0 =
* Initial commit
= 1.1.6 =
* Added GitHub action for releases
* Moved changelog to GitHub

= 1.0.1 =
* Updated dependencies

= 1.0.2 =
* Updated compatibility-flag for WordPress 6.0

= 1.0.3 =
* Updated compatibility-flag for WordPress 6.0.1
* Added build-system in repository

= 1.1.0 =
* Added translations for german (formal), spanisch and italian
* Fixed setting of default value for our plugin-option
* Updated compatibility-flag for WordPress 6.2
* Updated dependencies
* Cleanup repository

= 1.1.1 =
* Optimized translation-handling during plugin-build
* Compatible with WordPress Coding Standards
* Updated compatibility-flag for WordPress 6.3
* Updated dependencies

= 1.1.2 =
* Updated compatibility-flag for WordPress 6.4
* Updated dependencies
* Compatible with WordPress Coding Standards 3.0

= 1.1.3 =
* Removed language files from release
* Cleaned js-files
* Updated dependencies (security fixes in them)

= 1.1.4 =
* Updated compatibility-flag for WordPress 6.5
* Updated dependencies (security fixes in them)

= 1.1.5 =
* Updated compatibility-flag for WordPress 6.7
* Updated dependencies (security fixes in them)
[older changes](https://github.com/threadi/image-upload-for-imgur/blob/master/changelog.md)
18 changes: 18 additions & 0 deletions ruleset.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="ImgurImageUpload" namespace="ImgurImageUpload\ImgurImageUpload" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">

<description>Play Audio Once Coding Standards</description>

<rule ref="WordPress-Docs"/>
<rule ref="WordPress-Extra"/>
<rule ref="WordPress">
<!-- Exclude direkt db query warnings -->
<exclude name="WordPress.DB.DirectDatabaseQuery"/>
<exclude name="WordPress.DB.PreparedSQL.NotPrepared"/>
<!-- Excluded in favour to match PSR-4-namings of classes. -->
<exclude name="WordPress.Files.FileName"/>
<!-- Exclude override of globals -->
<exclude name="WordPress.WP.GlobalVariablesOverride"/>
</rule>

</ruleset>

0 comments on commit acadcd3

Please sign in to comment.