aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/release-build.yaml
blob: c64fbda98526994a67be0a0c07f723a429d32e43 (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
name: "Release Build"

on:
  workflow_dispatch:
    inputs:
      version:
        required: true
        type: string
        description: 'The server and web release tag ("vX.Y.Z") or "master"'

permissions:
  contents: read

jobs:
  Debian:
    runs-on: ubuntu-22.04
    strategy:
      matrix:
        release:
          - bullseye
          - bookworm
        arch:
          - amd64
          - arm64
          - armhf
    steps:
      - name: "Install dependencies"
        run: |-
          sudo apt-get install --yes python3-git

      - name: "Checkout Repository"
        uses: actions/checkout@v3

      - name: "Prepare Repository"
        run: |-
          ./checkout.py ${{ github.event.client_payload.version }}

      - name: "Run builder for Debian ${{ matrix.version }} ${{ matrix.arch }}"
        run: |-
          sudo ./build.py ${{ inputs.version }} debian ${{ matrix.arch }} ${{ matrix.release }}

      - name: "Upload artifacts to repository server"
        uses: appleboy/scp-action@v0.1.7
        with:
          host: "${{ secrets.REPO_HOST }}"
          username: "${{ secrets.REPO_USER }}"
          key: "${{ secrets.REPO_KEY }}"
          source: "out/debian/*"
          strip_components: 2
          target: "/srv/incoming/${{ inputs.version }}/debian/${{ matrix.arch }}/${{ matrix.release }}"

      - name: "Import artifacts into reprepro"
        uses: nekiro/ssh-job@main
        with:
          host: "${{ secrets.REPO_HOST }}"
          username: "${{ secrets.REPO_USER }}"
          key: "${{ secrets.REPO_KEY }}"
          command: |-
            if [[ ${{ inputs.version }} == "master" ]]; then
                COMPONENT="unstable"
            else
                COMPONENT="unstable"
            fi
            sudo reprepro --basedir --component ${COMPONENT} /srv/debian includedeb ${{ matrix.release }} /srv/incoming/${{ inputs.version }}/debian/${{ matrix.arch }}/${{ matrix.release }}/*.deb
            sudo reprepro --basedir --component ${COMPONENT} /srv/debian includedsc ${{ matrix.release }} /srv/incoming/${{ inputs.version }}/dscian/${{ matrix.arch }}/${{ matrix.release }}/*.dsc

      - name: "Move artifacts into repository"
        uses: nekiro/ssh-job@main
        with:
          host: "${{ secrets.REPO_HOST }}"
          username: "${{ secrets.REPO_USER }}"
          key: "${{ secrets.REPO_KEY }}"
          command: |-
            sudo mkdir -p /srv/repository/mirror/releases/server/debian/versions/${{ inputs.version }}/${{ matrix.arch }}
            sudo mv -t /srv/repository/mirror/releases/server/debian/versions/${{ inputs.version }}/${{ matrix.arch }} /srv/incoming/${{ inputs.version }}/debian/${{ matrix.arch }}/${{ matrix.release }}/*.deb
            if [[ ${{ inputs.version }} != "master" ]]; then
                sudo ln -s /srv/repository/mirror/releases/server/debian/versions/${{ inputs.version }}/${{ matrix.arch }} /srv/repository/mirror/releases/server/debian/latest-server
            fi

bgstack15