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

Chore: Update the plugin repository with GitHub Actions #18

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
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
43 changes: 43 additions & 0 deletions .github/workflows/update-repo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Update plugin repo
on:
schedule:
- cron: "*/30 * * * *"
workflow_dispatch:
permissions:
contents: write
jobs:
PluginRepo:
runs-on: ubuntu-latest
steps:
- name: Checkout Joplin plugin repository
uses: actions/checkout@v4
with:
ref: master
path: 'plugins'

- name: Install Node
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Prepare git
shell: bash
# Makes the commit author be shown as the Joplin Bot in the
# GitHub UI.
run: |
git config --global user.name "joplinbot"
git config --global user.email "[email protected]"

- name: Build
shell: bash
# See https://github.com/actions/checkout/pull/1707
run: |
mkdir ./plugin-repo-builder/
cd ./plugin-repo-builder/ && npm install @joplin/plugin-repo-cli
echo "Installed @joplin/plugin-repo-cli!"
# Use NodeJS to resolve plugin-repo-cli
echo 'require("@joplin/plugin-repo-cli")' > main.js
# plugin-repo-cli requires absolute paths.
node main.js build "$(realpath ../plugins/)"
env:
JOPLIN_GITHUB_OAUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}