Skip to content

Commit

Permalink
Add manual release creation action
Browse files Browse the repository at this point in the history
  • Loading branch information
s4ddly committed Jun 24, 2024
1 parent 95f70a0 commit d560a08
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 22 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/create_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Create release

on:
workflow_dispatch:
inputs:
version:
description: 'Version to create'
required: true

jobs:
create_release:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3

- uses: shivammathur/setup-php@v2
with:
php-version: 5.6
extensions: none, curl, dom, mbstring, simplexml, tokenizer, xml, xmlwriter, json
coverage: none

- run: git archive --output=tpay-openapi-php.zip HEAD

- run: zip -ur tpay-openapi-php.zip vendor/

- name: Create Github release
uses: ncipollo/release-action@v1
with:
tag: ${{ github.event.inputs.version }}
name: "v${{ github.event.inputs.version }}"
generateReleaseNotes: true
artifacts: tpay-openapi-php.zip

47 changes: 47 additions & 0 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Pull request

on:
pull_request:

permissions:
contents: write

jobs:
check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: shivammathur/setup-php@v2
with:
php-version: 5.6
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-openapi-php.zip HEAD

- run: zip -ur tpay-openapi-php vendor/

- run: mkdir sdk && unzip tpay-openapi-php.zip -d plugin

- uses: actions/upload-artifact@v4
id: plugin-upload
with:
name: 'tpay-woocommerce'
path: 'sdk/'

- uses: actions/github-script@v6
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 OpenAPI SDK - ${{ steps.plugin-upload.outputs.artifact-url }}'
})
22 changes: 0 additions & 22 deletions .github/workflows/release.yaml

This file was deleted.

0 comments on commit d560a08

Please sign in to comment.