Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle origin/main for new release validation , bump node 20 #286

Merged
merged 2 commits into from
Jun 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 25 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,51 +15,64 @@ jobs:
steps:
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: "install Dependencies"
- 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
- name: "Clone pkp/plugin-gallery"
run: |
cd ~
git clone https://github.com/pkp/plugin-gallery --depth 50
shell: bash

- name: Clone user plugin-gallery 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
cd ~/${{github.event.pull_request.head.repo.name || github.event.repository.name }}
git remote add user_repo https://github.com/${{ github.repository}}
git fetch user_repo ${{ github.head_ref || github.ref_name }}
git checkout -b user_repo/${{ github.head_ref || github.ref_name }}
shell: bash

- name: Install for pull_request
- name: lone user plugin-gallery 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
cd ~/${{github.event.pull_request.head.repo.name || github.event.repository.name }}
git remote add user_repo ${{ github.event.pull_request.head.repo.html_url}}
git fetch user_repo ${{ github.event.pull_request.head.ref}}
git checkout user_repo/${{ github.event.pull_request.head.ref}}
shell: bash

- name: "Run plugin validation"
- name: Validate against plugins.xd schema
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
- name: Validate all releases
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
- name: Validate new release
if: ${{ github.event_name == 'pull_request'}}
run: |
cd ~/${{github.event.pull_request.head.repo.name || github.event.repository.name }}
pwd
git remote -v
git branch
pkp-plugin validate-new-release
shell: bash

- name: For push
- name: Generate site
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
shell: bash