|
| 1 | +--- |
| 2 | +name: Download Release |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + inputs: |
| 7 | + year: |
| 8 | + required: true |
| 9 | + description: texlive year |
| 10 | + default: 2024 |
| 11 | + type: number |
| 12 | + latest: |
| 13 | + required: true |
| 14 | + description: This is latest release |
| 15 | + default: true |
| 16 | + type: boolean |
| 17 | + |
| 18 | +concurrency: |
| 19 | + group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.year }} |
| 20 | + cancel-in-progress: true |
| 21 | + |
| 22 | +permissions: |
| 23 | + contents: write |
| 24 | + |
| 25 | +jobs: |
| 26 | + historic: |
| 27 | + name: Download ${{ inputs.year }} |
| 28 | + runs-on: ubuntu-latest |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@main |
| 31 | + |
| 32 | + - name: Generate release notes |
| 33 | + run: | |
| 34 | + echo 'This is texlive-${{inputs.year}} release' > RELEASE.md |
| 35 | + echo 'Please download all `texlive_${{inputs.year}}_partXX` files first.' >> RELEASE.md |
| 36 | + echo 'Then run `cat texlive_${{inputs.year}}_part* > texlive.tar` to get the final tar file.' >> RELEASE.md |
| 37 | + echo 'Finally, run `tar -xf texlive.tar` to extract the files.' >> RELEASE.md |
| 38 | + cat RELEASE.md |
| 39 | +
|
| 40 | + - name: Download latest |
| 41 | + if: inputs.latest |
| 42 | + run: |- |
| 43 | + mkdir -p texlive |
| 44 | + rsync -axz --delete "rsync://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/tlnet/" texlive |
| 45 | + tar -cf archive.tar texlive |
| 46 | + rm -rf texlive |
| 47 | + split -d -n 4 archive.tar "texlive_${{matrix.year}}_part" |
| 48 | + rm -f archive.tar |
| 49 | + ls -lh |
| 50 | +
|
| 51 | + - name: Download historic |
| 52 | + if: inputs.latest == 0 |
| 53 | + run: |- |
| 54 | + mkdir -p texlive |
| 55 | + rsync -axz --delete "rsync://mirrors.tuna.tsinghua.edu.cn/tex-historic-archive/systems/texlive/${{inputs.year}}/tlnet-final/" texlive |
| 56 | + tar -cf archive.tar texlive |
| 57 | + rm -rf texlive |
| 58 | + split -d -n 4 archive.tar "texlive_${{inputs.year}}_part" |
| 59 | + rm -f archive.tar |
| 60 | + ls -lh |
| 61 | +
|
| 62 | + - name: Upload latest release |
| 63 | + if: inputs.latest |
| 64 | + env: |
| 65 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 66 | + run: |- |
| 67 | + gh release create "texlive-${{inputs.year}}" --latest --title "texlive-${{inputs.year}}" --notes-file RELEASE.md -R ${{ github.repository }} || true |
| 68 | + gh release edit "texlive-${{inputs.year}}" --latest --title "texlive-${{inputs.year}}" --notes-file RELEASE.md -R ${{ github.repository }} || true |
| 69 | + gh release upload --clobber "texlive-${{inputs.year}}" ./texlive_${{inputs.year}}_part* -R ${{ github.repository }} |
| 70 | +
|
| 71 | + - name: Upload historic release |
| 72 | + if: inputs.latest == 0 |
| 73 | + env: |
| 74 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 75 | + run: |- |
| 76 | + gh release create "texlive-${{inputs.year}}" --latest=false --title "texlive-${{inputs.year}}" --notes-file RELEASE.md -R ${{ github.repository }} || true |
| 77 | + gh release edit "texlive-${{inputs.year}}" --title "texlive-${{inputs.year}}" --notes-file RELEASE.md -R ${{ github.repository }} || true |
| 78 | + gh release upload --clobber "texlive-${{inputs.year}}" ./texlive_${{inputs.year}}_part* -R ${{ github.repository }} |
0 commit comments