Skip to content

Commit

Permalink
Add assets building script
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanPetakNeuralab committed Mar 21, 2024
1 parent c606726 commit cd63d08
Show file tree
Hide file tree
Showing 13 changed files with 12,206 additions and 126 deletions.
14 changes: 9 additions & 5 deletions .distignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
assets/src
node_modules
.wordpress-org
.git
.github
.distignore
.gitignore
.editorconfig
.git
.github
.wordpress-org
node_modules
phpcs.xml
composer.json
composer.lock
README.md
license.txt
package-lock.json
package.json
package-lock.json
mix-manifest.json
webpack.mix.js
60 changes: 32 additions & 28 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
name: Deploy to WordPress.org
on:
release:
types: [published]
jobs:
tag:
name: New release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: WordPress Plugin Deploy
id: deploy
uses: 10up/action-wordpress-plugin-deploy@stable
with:
generate-zip: true
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
- 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: ${{github.workspace}}/${{ github.event.repository.name }}.zip
asset_name: ${{ github.event.repository.name }}.zip
asset_content_type: application/zip
name: Deploy to WordPress.org
on:
release:
types: [published]
jobs:
tag:
name: New release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build assets
run: |
npm install
npx mix --production
- name: WordPress Plugin Deploy
id: deploy
uses: 10up/action-wordpress-plugin-deploy@stable
with:
generate-zip: true
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
- 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: ${{github.workspace}}/${{ github.event.repository.name }}.zip
asset_name: ${{ github.event.repository.name }}.zip
asset_content_type: application/zip
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
*.log
node_modules/
assets/dist
mix-manifest.json
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
176 changes: 88 additions & 88 deletions assets/css/kekspay.css → assets/src/scss/kekspay.scss
Original file line number Diff line number Diff line change
@@ -1,88 +1,88 @@
.kekspay {
display: flex;
justify-content: center;
margin-top: 24px;
}

.kekspay-url__wrap {
display: none;
}

.kekspay-qr {
margin-bottom: 24px;
padding-top: 24px;
display: flex;
align-items: center;
}

@media screen and (max-width: 782px) {
.kekspay-qr {
display: block;
}
}

.kekspay-qr-code {
background-repeat: no-repeat;
width: 245px;
height: 245px;
}

.kekspay-qr__instructions {
margin-right: 12px;
}

.kekspay-qr__instructions ol {
margin-bottom: 0;
}

/**
* Target smartphones and touch screen devices
*
* https://www.w3.org/TR/mediaqueries-4/#mf-interaction
*/
@media (hover:none), (hover:on-demand), (pointer:coarse) {
.kekspay-qr {
display: none;
}

.kekspay-url__wrap {
display: block;
}
}

.kekspay-logo {
width: 300px;
height: 129px;
margin: 0 auto;
}

.payment_method_erste-kekspay-woocommerce .kekspay-logo {
float: right;
width: 70px;
height: 30px;
}

.kekspay-icon-pay {
display: inline;
vertical-align: middle;

width: 34px;
height: 34px;
}

a.kekspay-sell-button {
background: #21A3E9;
border-radius: 3px;
color: #fff;
cursor: pointer;
display: inline-block;
padding: 16px 24px;
text-align: center;
text-decoration: none;
text-transform: none;
}

a.kekspay-cancel {
display: inline-block;
margin-top: 24px;
}
.kekspay {
display: flex;
justify-content: center;
margin-top: 24px;
}

.kekspay-url__wrap {
display: none;
}

.kekspay-qr {
margin-bottom: 24px;
padding-top: 24px;
display: flex;
align-items: center;
}

@media screen and (max-width: 782px) {
.kekspay-qr {
display: block;
}
}

.kekspay-qr-code {
background-repeat: no-repeat;
width: 245px;
height: 245px;
}

.kekspay-qr__instructions {
margin-right: 12px;
}

.kekspay-qr__instructions ol {
margin-bottom: 0;
}

/**
* Target smartphones and touch screen devices
*
* https://www.w3.org/TR/mediaqueries-4/#mf-interaction
*/
@media (hover:none), (hover:on-demand), (pointer:coarse) {
.kekspay-qr {
display: none;
}

.kekspay-url__wrap {
display: block;
}
}

.kekspay-logo {
width: 300px;
height: 129px;
margin: 0 auto;
}

.payment_method_erste-kekspay-woocommerce .kekspay-logo {
float: right;
width: 70px;
height: 30px;
}

.kekspay-icon-pay {
display: inline;
vertical-align: middle;

width: 34px;
height: 34px;
}

a.kekspay-sell-button {
background: #21A3E9;
border-radius: 3px;
color: #fff;
cursor: pointer;
display: inline-block;
padding: 16px 24px;
text-align: center;
text-decoration: none;
text-transform: none;
}

a.kekspay-cancel {
display: inline-block;
margin-top: 24px;
}
4 changes: 2 additions & 2 deletions includes/utilities/class-kekspay-data.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@ public static function get_auth_token() {
* @return string
*/
public static function get_svg( $svg ) {
if ( ! $svg || ! file_exists( KEKSPAY_DIR_PATH . 'assets/img/' . $svg . '.svg' ) ) {
if ( ! $svg || ! file_exists( KEKSPAY_DIR_PATH . 'assets/dist/img/' . $svg . '.svg' ) ) {
return false;
}

return file_get_contents( KEKSPAY_DIR_PATH . 'assets/img/' . $svg . '.svg' );
return file_get_contents( KEKSPAY_DIR_PATH . 'assets/dist/img/' . $svg . '.svg' );
}

/**
Expand Down

0 comments on commit cd63d08

Please sign in to comment.