-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: publish texlive archive to github release
Using `rsync` to download CTAN repo is slow and does not support high concurrency So, we download it and use `tar` to compress it into a single file. Because GitHub Release has a 2GB file size limit, we split it into 4 chunks.
- Loading branch information
Showing
2 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
name: Download Historic | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
paths: | ||
- .github/workflows/download-texlive-historic.yml | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
historic: | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 2 | ||
matrix: | ||
year: [2018, 2019, 2020, 2021, 2022] | ||
name: Download ${{ matrix.year }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@main | ||
|
||
- name: Generate release notes | ||
run: | | ||
echo 'This is texlive-${{matrix.year}} release' > RELEASE.md | ||
echo 'Please download all `texlive_${{matrix.year}}_part_X` files first.' >> RELEASE.md | ||
echo 'Then run `cat texlive_${{matrix.year}}_part_* > texlive.tar` to get the final tar file.' >> RELEASE.md | ||
echo 'Finally, run `tar -xf texlive.tar` to extract the files.' >> RELEASE.md | ||
cat RELEASE.md | ||
- name: Download | ||
run: |- | ||
mkdir -p texlive | ||
rsync -axz --delete "rsync://mirrors.tuna.tsinghua.edu.cn/tex-historic-archive/systems/texlive/${{matrix.year}}/tlnet-final/" texlive | ||
tar -cf archive.tar texlive | ||
rm -rf texlive | ||
split -d -n 4 archive.tar "texlive_${{matrix.year}}_part" | ||
rm -f archive.tar | ||
ls -lh | ||
- name: Upload to Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: |- | ||
gh release delete "texlive-${{matrix.year}}" --cleanup-tag --yes || true | ||
gh release create "texlive-${{matrix.year}}" --title "texlive-${{matrix.year}}" --notes-file RELEASE.md ./texlive_${{matrix.year}}_part* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
name: Download Latest | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: 0 7 1 * * | ||
push: | ||
paths: | ||
- .github/workflows/download-texlive-latest.yml | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
latest: | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 1 | ||
matrix: | ||
year: [2023] | ||
name: Download ${{ matrix.year }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@main | ||
|
||
- name: Generate release notes | ||
run: | | ||
echo 'This is texlive-${{matrix.year}} release' > RELEASE.md | ||
echo 'Please download all `texlive_${{matrix.year}}_part_X` files first.' >> RELEASE.md | ||
echo 'Then run `cat texlive_${{matrix.year}}_part_* > texlive.tar` to get the final tar file.' >> RELEASE.md | ||
echo 'Finally, run `tar -xf texlive.tar` to extract the files.' >> RELEASE.md | ||
cat RELEASE.md | ||
- name: Download | ||
run: |- | ||
mkdir -p texlive | ||
rsync -axz --delete "rsync://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/tlnet/" texlive | ||
tar -cf archive.tar texlive | ||
rm -rf texlive | ||
split -d -n 4 archive.tar "texlive_${{matrix.year}}_part" | ||
rm -f archive.tar | ||
ls -lh | ||
- name: Upload to Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: |- | ||
gh release delete "texlive-${{matrix.year}}" --cleanup-tag --yes || true | ||
gh release create "texlive-${{matrix.year}}" --title "texlive-${{matrix.year}}" --notes-file RELEASE.md --latest ./texlive_${{matrix.year}}_part* |