Sync from Melpa #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
outputs: | |
package-archive-name: ${{ steps.package-archive-name.outputs.PACKAGE_ARCHIVE_NAME }} | |
steps: | |
- name: Generate package archive's name | |
id: package-archive-name | |
run: | |
echo "PACKAGE_ARCHIVE_NAME=$(date +"%Y-%m-%d")" >> $GITHUB_ENV | |
- name: Sync in Melpa packages files | |
run: rsync -avz --compress-choice=zstd --delete rsync://melpa.org/packages/ "${PACKAGE_ARCHIVE_NAME}/" | |
- name: Pack the files | |
run: XZ_OPT=-9 tar Jcvf "${PACKAGE_ARCHIVE_NAME}.tar.xz" "${PACKAGE_ARCHIVE_NAME}/" | |
- name: Upload as artifact | |
uses: actions/[email protected] | |
with: | |
name: ${{ env.PACKAGE_ARCHIVE_NAME }}.tar.xz | |
path: ${{ env.PACKAGE_ARCHIVE_NAME }}.tar.xz | |
if-no-files-found: error | |
upload: | |
name: Upload to releases | |
runs-on: ubuntu-24.04 | |
needs: [sync-melpa] | |
env: | |
PACKAGE_ARCHIVE_NAME: ${{ needs.sync-melpa.outputs.package-archive-name }} | |
permissions: | |
contents: write | |
steps: | |
# Check out, otherwise gh doesn't know which repo to upload to. | |
- uses: actions/[email protected] | |
- name: Generate package archive's name | |
run: | |
echo "PACKAGE_ARCHIVE_NAME=$(date +"%Y-%m-%d")" >> $GITHUB_ENV | |
- uses: actions/[email protected] | |
with: | |
name: ${{ env.PACKAGE_ARCHIVE_NAME }}.tar.xz | |
path: ${{ env.PACKAGE_ARCHIVE_NAME }}.tar.xz | |
- name: Upload to release | |
if: github.ref == 'refs/heads/master' | |
run: gh release upload packages ${PACKAGE_ARCHIVE_NAME}.tar.xz | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |