Skip to content

Sync from Melpa

Sync from Melpa #21

Workflow file for this run

# @license GPL-3.0-or-later
#
# Copyright 2025 Hong Xu <[email protected]>
#
# This file is part of Delpa.
#
# Delpa is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# Delpa is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# Delpa. If not, see <https://www.gnu.org/licenses/>.
name: Sync from Melpa
on:
workflow_dispatch: {}
pull_request:
branches: ["master"]
schedule:
- cron: '0 0 2 * *'
jobs:
sync-melpa:
name: Sync packages from Melpa
runs-on: ubuntu-24.04
steps:
- name: Sync in Melpa packages files
run: rsync -avz --compress-choice=zstd --delete rsync://melpa.org/packages/ "packages/"
- name: Upload as artifact
uses: actions/[email protected]
with:
name: packages
path: packages
if-no-files-found: error
create-repo:
name: Create the repo
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-24.04
needs: [sync-melpa]
steps:
- name: Generate package archive's name
id: package-archive-name
run:
echo "PACKAGE_ARCHIVE_NAME=$(date +"%Y-%m-%d")" >> $GITHUB_ENV
- uses: actions/[email protected]
with:
name: packages
- name: Create local repo
run: |
git init .
git config user.email [email protected]
git config user.name "Delpa Bot"
echo "[Melpa](https://melpa.org) snapshot on ${PACKAGE_ARCHIVE_NAME}" > README.md
git add .
git commit -m "Initial commit"
- name: Create org repo
run: |
gh repo create "delpa-org/snapshot-${PACKAGE_ARCHIVE_NAME}" -d "Melpa snapshot on ${PACKAGE_ARCHIVE_NAME}" --disable-wiki --public --source . --push
env:
GH_TOKEN: ${{ secrets.ORG_GITHUB_TOKEN }}