aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/.github/workflows/yandex-cloud-cli-bin.yml
blob: f57462bd7a89658d15feb8fa59374125b9b86ca7 (plain) (blame)
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
name: yandex-cloud-cli-bin

on:
  workflow_call:
  workflow_dispatch:

# For good reasons, GitHub Actions people made the decision to add the
# container: functionality. For some other reason, when running inside a
# container:, they made an insane, completely batshit crazy decision to set
# $HOME to something other than /root. This breaks a bunch of things, which is
# why all the insanity is there below.
#
# makepkg people are similarly insane, which is why they hard-forbid running
# makepkg as root, because they're crazy. This is cause for the other stupid
# workarounds below.

jobs:
  maintenance:
    runs-on: ubuntu-latest
    container:
      image: archlinux:base-devel
    steps:
      - name: Install dependencies
        run: |
          pacman -Sy --noconfirm git openssh
      - name: Add builder user
        run: |
          useradd -m -s /bin/bash builder
      - name: Add SSH key
        run: |
          mkdir -p /home/builder/.ssh/
          cat > /home/builder/.ssh/config <<'EOF'
          StrictHostKeyChecking no
          EOF
          cat > /home/builder/.ssh/id_ed25519 <<'EOF'
          ${{ secrets.SSH_KEY }}
          EOF
          chown -R builder:builder /home/builder/.ssh
          chmod 0600 /home/builder/.ssh/id_ed25519
      - name: Configure git
        run: |
          runuser -u builder -- git config --global user.name 'Egor Tensin'
          runuser -u builder -- git config --global user.email 'egor@tensin.name'
      - name: Run maintenance
        run: |
          runuser -u builder -- git clone -q ssh://aur@aur.archlinux.org/yandex-cloud-cli-bin.git /home/builder/yandex-cloud-cli-bin
          runuser -u builder -- make -C /home/builder/yandex-cloud-cli-bin maintenance