summaryrefslogtreecommitdiffstats
path: root/.github/workflows/continuous-build.yml
blob: 7bffe29571d1a083b3de6bdb431eed8653e20db3 (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
111
112
113
114
115
116
117
name: Continuous Build Linux

on:
  push
    paths:
      - 'src/**'
      - 'include/**'
      - 'Makefile'
      - '.github/workflows/continuous-build.yml'

jobs:
  build:

    runs-on: ubuntu-latest
    container: ubuntu:21.04

    steps:
      - uses: actions/checkout@v2
      - name: Install build tools
        run: |
          apt update && \
          apt install coreutils sed git build-essential gcc-11 g++-11 -y
          apt install -y g++-11-aarch64-linux-gnu g++-11-i686-linux-gnu \
          g++-11-arm-linux-gnueabi  g++-11-arm-linux-gnueabihf g++-11-riscv64-linux-gnu \
          g++-11-sparc64-linux-gnu

          mkdir -p multiarch_bin

          git init # [fix Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).]

      - name: Compile x86_64
        run: |
          make CXX=g++-11 ARCH=x86_64 STATIC=true QUIET=true
          GIT_HASH=$(git rev-parse --short "$GITHUB_SHA")
          mv bin/btop multiarch_bin/btop-x86_64-$GIT_HASH
          make distclean

      - name: Compile i686
        run: |
          make CXX=i686-linux-gnu-g++-11 ARCH=i686 STATIC=true QUIET=true
          GIT_HASH=$(git rev-parse --short "$GITHUB_SHA")
          mv bin/btop multiarch_bin/btop-i686-$GIT_HASH
          make distclean

      - name: Compile aarch64
        run: |
          make CXX=aarch64-linux-gnu-g++-11 ARCH=aarch64 STATIC=true QUIET=true
          GIT_HASH=$(git rev-parse --short "$GITHUB_SHA")
          mv bin/btop multiarch_bin/btop-aarch64-$GIT_HASH
          make distclean

      - name: Compile armel
        run: |
          make CXX=arm-linux-gnueabi-g++-11 ARCH=armel STATIC=true QUIET=true
          GIT_HASH=$(git rev-parse --short "$GITHUB_SHA")
          mv bin/btop multiarch_bin/btop-armel-$GIT_HASH
          make distclean

      - name: Compile armhf
        run: |
          make CXX=arm-linux-gnueabihf-g++-11 ARCH=armhf STATIC=true QUIET=true
          GIT_HASH=$(git rev-parse --short "$GITHUB_SHA")
          mv bin/btop multiarch_bin/btop-armhf-$GIT_HASH
          make distclean

      - name: Compile riscv64
        run: |
          make CXX=riscv64-linux-gnu-g++-11 ARCH=riscv64 STATIC=true QUIET=true
          GIT_HASH=$(git rev-parse --short "$GITHUB_SHA")
          mv bin/btop multiarch_bin/btop-riscv64-$GIT_HASH
          make distclean

      - name: Compile sparc64
        run: |
          make CXX=sparc64-linux-gnu-g++-11 ARCH=sparc64 STATIC=true QUIET=true
          GIT_HASH=$(git rev-parse --short "$GITHUB_SHA")
          mv bin/btop multiarch_bin/btop-sparc64-$GIT_HASH
          make distclean

      - name: Make executable
        run: |
          chmod +x multiarch_bin/*

      - uses: actions/upload-artifact@v2
        with:
          name: btop-x86_64
          path: 'multiarch_bin/btop-x86_64*'

      - uses: actions/upload-artifact@v2
        with:
          name: btop-i686
          path: 'multiarch_bin/btop-i686*'

      - uses: actions/upload-artifact@v2
        with:
          name: btop-aarch64
          path: 'multiarch_bin/btop-aarch64*'

      - uses: actions/upload-artifact@v2
        with:
          name: btop-armel
          path: 'multiarch_bin/btop-armel*'

      - uses: actions/upload-artifact@v2
        with:
          name: btop-armhf
          path: 'multiarch_bin/btop-armhf*'

      - uses: actions/upload-artifact@v2
        with:
          name: btop-riscv64
          path: 'multiarch_bin/btop-riscv64*'

      - uses: actions/upload-artifact@v2
        with:
          name: btop-sparc64
          path: 'multiarch_bin/btop-sparc64*'