Add build commands

This commit is contained in:
Ben Goldsworthy 2021-03-10 15:54:32 +00:00
parent 9e6f1f699a
commit a66d7b544f
6 changed files with 64 additions and 33 deletions

View file

@ -1,18 +1,34 @@
/.wordpress-org # A set of files you probably don't want in your WordPress.org distribution
/.git
/.github
/.phpdoc
/_tools
/contrib
/development
/vendor
.distignore .distignore
.editorconfig
.git
.gitignore .gitignore
.gitlab-ci.yml
.travis.yml
.DS_Store
Thumbs.db
behat.yml
bin
circle.yml
composer.json
composer.lock
Gruntfile.js
package.json
phpunit.xml
phpunit.xml.dist
multisite.xml
multisite.xml.dist
phpcs.ruleset.xml
CONTRIBUTING.md CONTRIBUTING.md
README.md README.md
SECURITY.md SECURITY.md
LICENSE LICENSE
wp-cli.local.yml
tests
vendor
node_modules
*.sql
*.tar.gz
*.zip
authors.txt authors.txt
composer.* composer.*

View file

@ -12,26 +12,34 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v2
#- name: Build - name: Build
#run: | run: |
#composer install composer install --no-dev --optimize-autoloader
#composer run build composer run build
- name: WordPress Plugin Deploy - name: Create artifact
id: deploy uses: montudor/action-zip@stable
uses: 10up/action-wordpress-plugin-deploy@stable
with: with:
generate-zip: true args: zip -X -r dist/footnotes.zip dist
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
- name: Upload release assets #- name: WordPress Plugin Deploy
uses: actions/upload-release-asset@v1 # 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 artifact
uses: actions/upload-artifact@v2
with:
name: footnotes
path: dist/footnotes.zip
- name: Upload to release
uses: JasonEtco/upload-to-release@master
with:
args: dist/footnotes.zip application/zip
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 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

1
.gitignore vendored
View file

@ -1,5 +1,6 @@
.phpdoc/ .phpdoc/
vendor/ vendor/
dist/
*.bak *.bak
authors.txt authors.txt

6
_tools/build.sh Executable file
View file

@ -0,0 +1,6 @@
#!/bin/sh
rm -r dist/
mkdir dist
cp -r -t dist class/ css/ js/ img/ languages/ templates/
cp -t dist features.txt license.txt readme.txt footnotes.php includes.php

0
_tools/setup.sh Normal file → Executable file
View file

View file

@ -1,11 +1,11 @@
{ {
"name": "markcheret/footnotes",
"scripts": {
"build": "./_tools/build.sh",
"post-install-cmd": "./_tools/setup.sh"
},
"require-dev": { "require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1", "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
"wp-coding-standards/wpcs": "^2.3" "wp-coding-standards/wpcs": "^2.3"
},
"scripts": {
"post-install-cmd": [
"bash _tools/setup.sh"
]
} }
} }