|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - '*.*' # Push events to matching v*, i.e. v1.0, v20.15.10 |
| 7 | + |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + |
| 11 | + runs-on: ubuntu-latest |
| 12 | + |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v2 |
| 15 | + |
| 16 | + # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" |
| 17 | + # Docs: https://getcomposer.org/doc/articles/scripts.md |
| 18 | + |
| 19 | + # - name: Run test suite |
| 20 | + # run: composer run-script test |
| 21 | + # cp -r disciple-tools-plugin-starter-template.php includes languages spinner.svg version-control.json LICENSE SECURITY.md disciple-tools-plugin-starter-template/ |
| 22 | + # Below borrowed from https://github.com/actions/upload-release-asset |
| 23 | + - name: Build project |
| 24 | + run: | |
| 25 | + mkdir disciple-tools-plugin-starter-template |
| 26 | + cp -r disciple-tools-plugin-starter-template.php admin charts languages magic-link post-type rest-api site-link tile spinner.svg version-control.json LICENSE SECURITY.md disciple-tools-plugin-starter-template/ |
| 27 | + zip -r disciple-tools-plugin-starter-template.zip disciple-tools-plugin-starter-template |
| 28 | + - name: Create Release |
| 29 | + id: create_release |
| 30 | + uses: actions/create-release@v1 |
| 31 | + env: |
| 32 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 33 | + with: |
| 34 | + tag_name: ${{ github.ref }} |
| 35 | + release_name: Release ${{ github.ref }} |
| 36 | + draft: false |
| 37 | + prerelease: false |
| 38 | + - name: Upload Release Asset |
| 39 | + id: upload-release-asset |
| 40 | + uses: actions/upload-release-asset@v1 |
| 41 | + env: |
| 42 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 43 | + with: |
| 44 | + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps |
| 45 | + asset_path: ./disciple-tools-plugin-starter-template.zip |
| 46 | + asset_name: disciple-tools-plugin-starter-template.zip |
| 47 | + asset_content_type: application/zip |
0 commit comments