Release #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
pull_request: | |
push: | |
tags: | |
- '*' | |
workflow_run: | |
workflows: [Create release] | |
types: | |
- completed | |
permissions: | |
contents: write | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 7.1 | |
extensions: none, curl, dom, mbstring, simplexml, tokenizer, xml, xmlwriter, json | |
coverage: none | |
- run: composer install --no-dev | |
- run: chmod 777 -R vendor | |
- run: git archive --output=tpay-woocommerce.zip HEAD | |
- run: zip -ur tpay-woocommerce.zip vendor/ | |
- uses: softprops/action-gh-release@v1 | |
if: github.event_name != 'pull_request' | |
with: | |
files: tpay-woocommerce.zip | |
- run: mkdir plugin && unzip tpay-woocommerce.zip -d plugin | |
- uses: actions/upload-artifact@v4 | |
id: plugin-upload | |
if: github.event_name == 'pull_request' | |
with: | |
name: 'tpay-woocommerce' | |
path: 'plugin/' | |
- uses: actions/github-script@v6 | |
if: github.event_name == 'pull_request' | |
with: | |
github-token: ${{ secrets.TOKEN }} | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: 'Tpay Woocommerce plugin - ${{ steps.plugin-upload.outputs.artifact-url }}' | |
}) |