diff --git a/.distignore b/.distignore new file mode 100644 index 0000000..88e6736 --- /dev/null +++ b/.distignore @@ -0,0 +1,7 @@ +/.wordpress-org +/.git +/.github +/node_modules + +.distignore +.gitignore diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..8483566 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,31 @@ +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 + run: | + composer install --no-dev --optimize-autoloader + - 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 \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b5763f1..67e10c6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,44 +1,31 @@ # GitHub Action: whenever creating a new release of the source code, -# also create a release of the installable plugin. -# Steps to execute: -# - Checkout the source code -# - Run "composer install" to download all dependencies under vendor/ -# - Create a .zip file, excluding: -# - All hidden files (.git, .gitignore, etc) -# - All development files, ending in .dist -# - All composer files <= after installing dependencies, no need for them anymore -# - Markdown files concerning development -# - Folder build/ <= created only to store the .zip file -# - Folder dev-helpers/ <= not needed for the plugin -# - Upload the .zip file as an artifact to the action (this step is possibly optional) -# - Upload the .zip file as a release, for download -name: Generate Installable Plugin, and Upload as Release Asset -on: - release: - types: [published] -jobs: - build: - name: Upload Release Asset - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Build project - run: | - composer install --no-dev --optimize-autoloader - mkdir build - - name: Create artifact - uses: montudor/action-zip@v0.1.0 - with: - args: zip -X -r build/wc-slack.zip . -x assets** *.git* node_modules/\* .* "*/\.*" *.package* *.dist composer.* dev-helpers** build** - - name: Upload artifact - uses: actions/upload-artifact@v2 - with: - name: WCSlack Zip - path: build/wc-slack.zip - - name: Upload to release - uses: JasonEtco/upload-to-release@master - with: - args: build/wc-slack.zip application/zip - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# name: Generate Installable Plugin, and Upload as Release Asset +# on: +# release: +# types: [published] +# jobs: +# build: +# name: Upload Release Asset +# runs-on: ubuntu-latest +# steps: +# - name: Checkout code +# uses: actions/checkout@v2 +# - name: Build project +# run: | +# composer install --no-dev --optimize-autoloader +# mkdir build +# - name: Create artifact +# uses: montudor/action-zip@v0.1.0 +# with: +# args: zip -X -r build/wc-slack.zip . -x assets** *.git* node_modules/\* .* "*/\.*" *.package* *.dist composer.* dev-helpers** build** +# - name: Upload artifact +# uses: actions/upload-artifact@v2 +# with: +# name: WCSlack Zip +# path: build/wc-slack.zip +# - name: Upload to release +# uses: JasonEtco/upload-to-release@master +# with: +# args: build/wc-slack.zip application/zip +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/assets/banner-1544x500.png b/.wordpress-org/banner-1544x500.png similarity index 100% rename from assets/banner-1544x500.png rename to .wordpress-org/banner-1544x500.png diff --git a/assets/banner-772x250.png b/.wordpress-org/banner-772x250.png similarity index 100% rename from assets/banner-772x250.png rename to .wordpress-org/banner-772x250.png diff --git a/assets/icon-128x128.png b/.wordpress-org/icon-128x128.png similarity index 100% rename from assets/icon-128x128.png rename to .wordpress-org/icon-128x128.png diff --git a/assets/icon-256x256.png b/.wordpress-org/icon-256x256.png similarity index 100% rename from assets/icon-256x256.png rename to .wordpress-org/icon-256x256.png diff --git a/assets/screenshot-1.png b/.wordpress-org/screenshot-1.png similarity index 100% rename from assets/screenshot-1.png rename to .wordpress-org/screenshot-1.png diff --git a/assets/screenshot-2.png b/.wordpress-org/screenshot-2.png similarity index 100% rename from assets/screenshot-2.png rename to .wordpress-org/screenshot-2.png