diff --git a/.distignore b/.distignore index b060721..1e3f757 100644 --- a/.distignore +++ b/.distignore @@ -1,18 +1,34 @@ -/.wordpress-org -/.git -/.github -/.phpdoc -/_tools -/contrib -/development -/vendor - +# A set of files you probably don't want in your WordPress.org distribution .distignore +.editorconfig +.git .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 README.md SECURITY.md LICENSE +wp-cli.local.yml +tests +vendor +node_modules +*.sql +*.tar.gz +*.zip authors.txt composer.* diff --git a/.github/workflows/deploy-to-wordpress.org.yml b/.github/workflows/deploy-to-wordpress.org.yml index c7b8487..3f8bbca 100644 --- a/.github/workflows/deploy-to-wordpress.org.yml +++ b/.github/workflows/deploy-to-wordpress.org.yml @@ -12,26 +12,34 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - #- name: Build - #run: | - #composer install - #composer run build + - name: Build + run: | + composer install --no-dev --optimize-autoloader + composer run build - - name: WordPress Plugin Deploy - id: deploy - uses: 10up/action-wordpress-plugin-deploy@stable + - name: Create artifact + uses: montudor/action-zip@stable with: - generate-zip: true - env: - SVN_USERNAME: ${{ secrets.SVN_USERNAME }} - SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} + args: zip -X -r dist/footnotes.zip dist + + #- 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 assets - uses: actions/upload-release-asset@v1 + - 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: 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 diff --git a/.gitignore b/.gitignore index de46eb3..494168f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .phpdoc/ vendor/ +dist/ *.bak authors.txt diff --git a/_tools/build.sh b/_tools/build.sh new file mode 100755 index 0000000..f700fe3 --- /dev/null +++ b/_tools/build.sh @@ -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 diff --git a/_tools/setup.sh b/_tools/setup.sh old mode 100644 new mode 100755 diff --git a/composer.json b/composer.json index 85ecd48..3029a61 100644 --- a/composer.json +++ b/composer.json @@ -1,11 +1,11 @@ { + "name": "markcheret/footnotes", + "scripts": { + "build": "./_tools/build.sh", + "post-install-cmd": "./_tools/setup.sh" + }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1", "wp-coding-standards/wpcs": "^2.3" - }, - "scripts": { - "post-install-cmd": [ - "bash _tools/setup.sh" - ] } }