Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Throw if tool name too long #48

Throw if tool name too long

Throw if tool name too long #48

Workflow file for this run

name: Nightly Build
on:
push:
branches:
- main
tags-ignore:
- nightly
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
# The concurrency group contains the workflow name and the branch name.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: write
pages: write
id-token: write
jobs:
build:
name: Nightly Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: latest
coverage: none
tools: wp-cli
- name: Install PHP dependencies
uses: ramsey/composer-install@v3
with:
composer-options: '--prefer-dist --no-progress --no-interaction --no-scripts --no-dev'
- name: Install latest version of dist-archive-command
run: wp package install wp-cli/dist-archive-command:dev-main
- name: Update version number
run: |
CURRENT_DATE=$(date +%Y.%-m.%-d)
sed -i -e "s/Version:.*/Version: 0.1.$CURRENT_DATE-${GITHUB_SHA::7}/g" ./mcp.php
- name: Create updates information
run: |
CURRENT_DATE=$(date +%Y.%m.%d)
cat > update.json <<-END
{
"id": "https://mcp-wp.github.io/mcp-server/update.json",
"slug": "mcp",
"version": "0.1.$CURRENT_DATE-${GITHUB_SHA::7}",
"url": "https://github.com/mcp-wp/mcp-server",
"package": "https://mcp-wp.github.io/mcp-server/mcp.zip",
"tested": "6.8",
"requires_php": "8.2",
"autoupdate": true
}
END
- name: Create ZIP file
run: wp dist-archive --plugin-dirname=mcp . ./mcp.zip
- name: Prepare GitHub Pages
run: |
mkdir -p _site
mv update.json _site/update.json
cp ./mcp.zip _site/mcp.zip
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
- name: Delete existing release
uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
try {
const response = await github.rest.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: "nightly"
});
github.rest.repos.deleteRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: response.data.id,
});
} catch {}
- name: Tag current commit
run: |
git config --local user.email "swissspidy@users.noreply.github.com"
git config --local user.name "swissspidy-bot"
git push origin :refs/tags/nightly
git tag -f nightly
git push origin --tags
deploy:
name: Deployment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Morty Proxy This is a proxified and sanitized view of the page, visit original site.