diff --git a/.github/workflows/create_release.yaml b/.github/workflows/create_release.yaml new file mode 100644 index 0000000..0c6f41f --- /dev/null +++ b/.github/workflows/create_release.yaml @@ -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 diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml new file mode 100644 index 0000000..0b25d87 --- /dev/null +++ b/.github/workflows/pull_request.yaml @@ -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 }}' + }) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index 712ad17..0000000 --- a/.github/workflows/release.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: Release - -on: - push: - tags: - - '*' - -permissions: - contents: write - -jobs: - check: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - run: git archive --output=tpay-magento2-basic.zip HEAD - - - uses: softprops/action-gh-release@v1 - with: - files: tpay-magento2-basic.zip