Skip to content

Commit

Permalink
Add manual action to create release (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
s4ddly authored Jun 25, 2024
1 parent ccf110a commit dd79f8b
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
name: Release
name: Create release

on:
push:
tags:
- '*'

permissions:
contents: write
workflow_dispatch:
inputs:
version:
description: 'Version to create'
required: true

jobs:
check:
create_release:
runs-on: ubuntu-latest

steps:
Expand All @@ -27,6 +26,10 @@ jobs:

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

- uses: softprops/action-gh-release@v1
- name: Create Github release
uses: ncipollo/release-action@v1
with:
files: tpay-php.zip
tag: ${{ github.event.inputs.version }}
name: "v${{ github.event.inputs.version }}"
generateReleaseNotes: true
artifacts: tpay-php.zip
45 changes: 45 additions & 0 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
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: git archive --output=tpay-php.zip HEAD

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

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

- uses: actions/upload-artifact@v4
id: plugin-upload
with:
name: 'tpay-php'
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 SDK - ${{ steps.plugin-upload.outputs.artifact-url }}'
})

0 comments on commit dd79f8b

Please sign in to comment.