-
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.
refactor(download): use manual input to download texlive release
- Loading branch information
Showing
3 changed files
with
78 additions
and
106 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,78 @@ | ||
--- | ||
name: Download Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
year: | ||
required: true | ||
description: texlive year | ||
default: 2024 | ||
type: number | ||
latest: | ||
required: true | ||
description: This is latest release | ||
default: true | ||
type: boolean | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.year }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
historic: | ||
name: Download ${{ inputs.year }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@main | ||
|
||
- name: Generate release notes | ||
run: | | ||
echo 'This is texlive-${{inputs.year}} release' > RELEASE.md | ||
echo 'Please download all `texlive_${{inputs.year}}_partXX` files first.' >> RELEASE.md | ||
echo 'Then run `cat texlive_${{inputs.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 latest | ||
if: inputs.latest | ||
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: Download historic | ||
if: inputs.latest == 0 | ||
run: |- | ||
mkdir -p texlive | ||
rsync -axz --delete "rsync://mirrors.tuna.tsinghua.edu.cn/tex-historic-archive/systems/texlive/${{inputs.year}}/tlnet-final/" texlive | ||
tar -cf archive.tar texlive | ||
rm -rf texlive | ||
split -d -n 4 archive.tar "texlive_${{inputs.year}}_part" | ||
rm -f archive.tar | ||
ls -lh | ||
- name: Upload latest release | ||
if: inputs.latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: |- | ||
gh release create "texlive-${{inputs.year}}" --latest --title "texlive-${{inputs.year}}" --notes-file RELEASE.md -R ${{ github.repository }} || true | ||
gh release edit "texlive-${{inputs.year}}" --latest --title "texlive-${{inputs.year}}" --notes-file RELEASE.md -R ${{ github.repository }} || true | ||
gh release upload --clobber "texlive-${{inputs.year}}" ./texlive_${{inputs.year}}_part* -R ${{ github.repository }} | ||
- name: Upload historic release | ||
if: inputs.latest == 0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: |- | ||
gh release create "texlive-${{inputs.year}}" --latest=false --title "texlive-${{inputs.year}}" --notes-file RELEASE.md -R ${{ github.repository }} || true | ||
gh release edit "texlive-${{inputs.year}}" --title "texlive-${{inputs.year}}" --notes-file RELEASE.md -R ${{ github.repository }} || true | ||
gh release upload --clobber "texlive-${{inputs.year}}" ./texlive_${{inputs.year}}_part* -R ${{ github.repository }} |