Skip to content

Commit

Permalink
Add create_release workflow and plugin file addition on PR (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
s4ddly authored Jun 25, 2024
1 parent 2a4fc12 commit 2e41e2c
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 22 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/create_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
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

- name: Check .version
run: if [ $(grep ${{ github.event.inputs.version }} .version -c) != 1 ]; then exit 1; fi

- name: Check Changelog
run: if [ $(grep ${{ github.event.inputs.version }} CHANGELOG.md -c) != 1 ]; then exit 1; fi

- run: git archive --output=tpay-magento2-basic.zip HEAD

- 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-magento2-basic.zip
31 changes: 31 additions & 0 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Pull request

on:
pull_request:

permissions:
contents: write

jobs:
check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/upload-artifact@v4
id: plugin-upload
with:
name: 'tpay-magento2-basic'
path: './'

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

This file was deleted.

0 comments on commit 2e41e2c

Please sign in to comment.