Update Mirror #2667
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
# SPDX-License-Identifier: GPL-2.0-only | |
# | |
# Copyright (C) 2021 ImmortalWrt.org | |
name: Update Mirror | |
on: | |
repository_dispatch: | |
workflow_dispatch: | |
schedule: | |
- cron: 0 2 * * * | |
jobs: | |
update-mirror: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
branch: | |
- master | |
- openwrt-23.05 | |
fail-fast: false | |
max-parallel: 1 | |
steps: | |
- name: Checkout the Repo | |
uses: actions/checkout@v4 | |
- name: Init Compilation Dependencies | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: | | |
sudo -E apt-get -qq update | |
sudo -E apt-get -qq install build-essential libncurses5-dev binutils bzip2 coreutils gawk gettext git patch zlib1g-dev subversion git-core gcc g++ p7zip-full libssl-dev autoconf automake libtool autopoint curl wget vim nano python3 python3-pip xz-utils tar unzip rsync | |
sudo -E apt-get -qq clean | |
- name: Checkout ImmortalWrt Source Tree on Branch ${{ matrix.branch }} | |
uses: actions/checkout@v4 | |
with: | |
repository: "immortalwrt/immortalwrt" | |
ref: ${{ matrix.branch }} | |
path: "immortalwrt" | |
- name: Update Feeds | |
run: | | |
cd "immortalwrt" | |
./scripts/feeds update -a | |
./scripts/feeds install -a | |
- name: Download Packages | |
run: | | |
cd "immortalwrt" | |
echo -e "CONFIG_ALL=y" > ".config" | |
make defconfig | |
make download -j8 | |
find dl -size -1024c -exec rm -f {} \; | |
- name: Upload Files to ImmortalWrt Download Server | |
env: | |
RSYNC_ADDR: ${{ secrets.RSYNC_ADDR }} | |
RSYNC_USER: ${{ secrets.RSYNC_USER }} | |
RSYNC_PASSWORD: ${{ secrets.RSYNC_PASS }} | |
run: | | |
find 'immortalwrt/dl/' -maxdepth 1 -type f -not -size 0 -not -name '.*' -not -name '*.hash' -not -name '*.dl' -printf '%f\n' > 'sourcelist' | |
rsync --files-from="sourcelist" --size-only --delay-updates --partial-dir=".~tmp~$GITHUB_RUN_ID" -ahv "immortalwrt/dl/" "rsync://${RSYNC_USER}@${RSYNC_ADDR}/dl/" | |
- name: Upload Files to SourceForge | |
uses: Pendect/action-rsyncer@9738db02560c333bf629a1533bd86ceda138e599 | |
with: | |
flags: '-ahv' | |
options: '--files-from=sourcelist --size-only' | |
src: 'immortalwrt/dl/' | |
dest: '${{ secrets.SF_USER }}@frs.sourceforge.net:/home/frs/project/immortalwrt/sources/' | |
env: | |
DEPLOY_KEY: ${{ secrets.SF_KEY }} | |
cleanup-workflow-runs: | |
runs-on: ubuntu-latest | |
needs: update-mirror | |
steps: | |
- name: Cleanup Workflow Runs | |
uses: Mattraks/delete-workflow-runs@v2 | |
with: | |
token: ${{ github.token }} | |
repository: ${{ github.repository }} | |
retain_days: 7 | |
keep_minimum_runs: 1 |