Skip to content

Commit

Permalink
refactor(core): 2.0.0
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Refactor
  • Loading branch information
dkjensen committed Jun 23, 2023
1 parent 210410c commit 8ccaced
Show file tree
Hide file tree
Showing 33 changed files with 11,858 additions and 7,774 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab

[*.{yml,yaml}]
indent_style = space
indent_size = 2
9 changes: 9 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": [ "plugin:@wordpress/eslint-plugin/recommended" ],
"rules": {
"@wordpress/no-unsafe-wp-apis": 0,
"no-console": "off",
"eqeqeq": "off",
"jsx-a11y/label-has-associated-control": "off"
}
}
51 changes: 34 additions & 17 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,52 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Check if secrets exist
env:
svn_username: ${{ secrets.SVN_USERNAME }}
svn_password: ${{ secrets.SVN_PASSWORD }}
if: ${{ (env.svn_username == '') || (env.svn_password == '') }}
run: exit 1

- name: Install npm packages
run: |
npm i
- name: Build
run: |
npm run build
- name: Semantic release
id: semantic
uses: codfish/semantic-release-action@master
uses: cycjimmy/semantic-release-action@v2
with:
semantic_version: 17
branches: |
['master']
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set env
if: steps.semantic.outputs.new_release_published == 'true'
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Build release
if: steps.semantic.outputs.new_release_published == 'true'
shell: bash
run: |
npm run plugin-zip
- name: Release
if: steps.semantic.outputs.new_release_published == 'true'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.semantic.outputs.new_release_version }}
files: |
dist/simple-tabs-block.zip
- name: WordPress Plugin Deploy
id: deploy
if: steps.semantic.outputs.new-release-published == 'true'
if: steps.semantic.outputs.new_release_published == 'true'
uses: 10up/[email protected]
with:
generate-zip: true
env:
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SLUG: simple-tabs-block
VERSION: ${{ steps.semantic.outputs.release-version }}
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ steps.deploy.outputs.zip-path }}
asset_name: ${{ github.event.repository.name }}.zip
asset_content_type: application/zip
VERSION: ${{ steps.semantic.outputs.new_release_version }}
BUILD_DIR: dist/simple-tabs-block
22 changes: 5 additions & 17 deletions .releaserc.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,21 @@
module.exports = {
tagFormat: "${version}",
branch: "master",
branches: ["master"],
plugins: [
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "changelog.txt"
}
],
[
"@semantic-release/git",
{
"assets": ["changelog.txt"]
}
],
["@semantic-release/npm", { npmPublish: false }],
"@semantic-release/github",
[
"semantic-release-plugin-update-version-in-files",
{
"files": [
"package.json",
"simple-tabs-block.php",
"readme.txt",
"build/tab/block.json",
"build/tabs/block.json"
"src/tabs/block.json",
"src/tab/block.json"
],
"placeholder": "0.0.0-development"
}
]
]
};
};
20 changes: 20 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll": true
},
"eslint.validate": [
"javascript",
"typescript"
],
"typescript.validate.enable": true,
"typescript.tsserver.experimental.enableProjectDiagnostics": true,
"stylelint.enable": true,
"stylelint.validate": [
"scss"
],
"css.validate": false,
"less.validate": false,
"scss.validate": false,
"stylelint.configFile": "node_modules/@wordpress/scripts/config/.stylelintrc.json"
}
Binary file added .wordpress-org/icon-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/icon-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .wordpress-org/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 3 additions & 6 deletions bin/build-zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ echo "Generating build directory..."
rm -rf "$BUILD_PATH"
mkdir -p "$DEST_PATH"

echo "Installing JS dependencies..."
npm i

echo "Running JS Build..."
npm run build || exit "$?"
echo "Building assets..."
npm run build

echo "Syncing files..."
rsync -rc --exclude-from="$PROJECT_PATH/.distignore" "$PROJECT_PATH/" "$DEST_PATH/" --delete --delete-excluded
Expand All @@ -25,4 +22,4 @@ zip -q -r "${PLUGIN_SLUG}.zip" "$PLUGIN_SLUG/"
cd "$PROJECT_PATH" || exit
echo "${PLUGIN_SLUG}.zip file generated!"

echo "Build done!"
echo "Build done!"
54 changes: 0 additions & 54 deletions changelog.txt

This file was deleted.

Loading

0 comments on commit 8ccaced

Please sign in to comment.