summaryrefslogtreecommitdiff
path: root/Build/source/.github/workflows/main.yml
blob: 88cf522d8ac49d7042b484bc56477fc55b0e6422 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# .github/workflows/main.yml for texlive-source CI building
#
# Norbert Preining
# Public Domain
#
# This file controls CI testing via Github Actions of the
# git-svn checkout of the TeX Live source directory
# which is pushed to Github
#   https://github.com/TeX-Live/texlive-source
# The cron job that does the git svn up and git push is
# running on texlive.info; see norbert cron there. Run cmd as norbert:
#   /home/norbert/git-svn-repos/git-svn-syncer --new texlive-source
#
# To make and retrieve new binaries:
# * go to https://github.com/TeX-Live/texlive-source/commits/master
#   and check that all commits you want are there (max waiting time 30min).
# * go to https://github.com/TeX-Live/texlive-source/releases
#   and "Draft new release" (does git tag).
# * wait 30min or so.
# * go to https://github.com/TeX-Live/texlive-source/releases/latest/
#   and there should be binaries for the new "release".
# * use tl-update-bindir.
#
# The actual code for building and running is in the Github Action
#   TeX-Live/tl-build-docker-action
#
# TODO
# * it would be nice if we could adjust the docker action usage
#   to override the dockerfile but this seems not to be possible at the moment

# only build on pushed to trunk
on:
  push:
    branches:
      - trunk

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  build_job:
    runs-on: ubuntu-latest
    name: Build on ${{ matrix.tl_name }}

    strategy:
      fail-fast: false
      matrix:
        include:
          - tl_name: i386-linux
            image: i386/ubuntu:xenial
            qemu_arch: 386
            platform: 386
          - tl_name: x86_64-linux
            image: centos:7
            qemu_arch: amd64
            platform: amd64
          - tl_name: x86_64-linuxmusl
            image: alpine:3.5
            qemu_arch: amd64
            platform: amd64
          - tl_name: aarch64-linux
            image: arm64v8/debian:buster
            qemu_arch: aarch64
            platform: aarch64
          - tl_name: armhf-linux
            image: arm32v7/debian:buster
            qemu_arch: arm
            platform: arm/v7

    steps:
      - name: checkout-main
        uses: actions/checkout@v4
        with:
          path: 'repo'
      - name: Setup QEMU
        if: startsWith(matrix.image, 'arm')
        uses: docker/setup-qemu-action@v2
        with:
          platforms: ${{ matrix.qemu_arch }}
      - name: build
        uses: addnab/docker-run-action@v3
        with: 
          image: ${{ matrix.image }}
          options: -v ${{ github.workspace }}:/work --platform linux/${{ matrix.platform }}
          run: |
            cd /work/repo
            case "${{ matrix.image }}" in
              i386/ubuntu:*) .github/scripts/install-deps.ubuntu.sh ;;
              */debian:*) .github/scripts/install-deps.ubuntu.sh ;;
              centos:*) .github/scripts/install-deps.centos.sh ;;
              alpine:*) .github/scripts/install-deps.alpine.sh ;;
            esac
            .github/scripts/build-tl.sh ${{ matrix.tl_name }}
      - name: find file step
        run: ls -l $GITHUB_WORKSPACE/repo/texlive-bin-${{ matrix.tl_name }}.tar.gz
      - name: save artifact
        uses: actions/upload-artifact@v4
        with:
          name: texlive-bin-${{ matrix.tl_name }}.tar.gz
          path: ${{ github.workspace }}/repo/texlive-bin-${{ matrix.tl_name }}.tar.gz
          compression-level: 0
      - name: Release
        uses: softprops/action-gh-release@v1
        if: startsWith(github.ref, 'refs/tags/')
        with:
          files: $GITHUB_WORKSPACE/repo/texlive-bin-${{ matrix.tl_name }}.tar.gz
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}