Skip to content

Commit

Permalink
Merge pull request #284 from withanage/main
Browse files Browse the repository at this point in the history
Github actions
  • Loading branch information
withanage authored May 31, 2024
2 parents fcc3381 + 65e76ba commit 158c68f
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
on:
push:
branches:
- '*'
pull_request:
branches:
['main']
env:
XML_SCHEMA: "plugins.xsd"

name: plugin-gallery
jobs:
plugin-gallery:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
with:
node-version: 18

- name: "install Dependencies"
run: |
sudo apt-get update -qq
sudo apt-get install libxml2-utils
npm install -g pkp-plugin-cli
shell: bash

- name: Install for push
if: ${{ github.event_name == 'push'}}
run: |
git clone -b ${{ github.head_ref || github.ref_name }} https://github.com/${{ github.repository}} ~/${{ github.event.repository.name }} --depth 5
shell: bash

- name: Install for pull_request
if: ${{github.event_name == 'pull_request'}}
run: |
git clone -b ${{ github.event.pull_request.head.ref}} ${{ github.event.pull_request.head.repo.html_url}} ~/${{ github.event.pull_request.head.repo.name }} --depth 5
shell: bash

- name: "Run plugin validation"
run: |
cd ~/${{github.event.pull_request.head.repo.name || github.event.repository.name }}
xmllint --schema ./plugins.xsd ./plugins.xml --noout
shell: bash

- name: For push
if: ${{ github.event_name == 'push' && github.head_ref == 'main'}}
run: |
cd ~/${{github.event.pull_request.head.repo.name || github.event.repository.name }}
pkp-plugin validate-all-releases --input ./plugins.xml
shell: bash

- name: For pull request
if: ${{ github.event_name == 'pull_request'}}
run: |
cd ~/${{github.event.pull_request.head.repo.name || github.event.repository.name }}
pwd
pkp-plugin validate-new-release
shell: bash

- name: For push
if: ${{ github.event_name == 'push' && github.head_ref == 'main'}}
run: |
cd ~/${{github.event.pull_request.head.repo.name || github.event.repository.name }}
GITHUB_TOKEN=${{secrets.GITHUB_TOKEN}} pkp-plugin generate-site ./plugins.xml
shell: bash

0 comments on commit 158c68f

Please sign in to comment.