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

Merged
Merged
Changes from 13 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
44 changes: 44 additions & 0 deletions .github/workflows/update-repo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Update plugin repo
on:
schedule:
- cron: "0 */6 * * *"
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 GitHub Actions in the
# GitHub UI.
# See https://github.com/actions/checkout/pull/1707
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"

- 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 }}