-
Notifications
You must be signed in to change notification settings - Fork 2
187 lines (186 loc) · 7.49 KB
/
ci.yml
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
name: ci
on:
push: {branches-ignore: [latest], tags: ['*']}
pull_request:
env:
PACKAGE_NAME: ${{ github.event.repository.name }}
MYCI_GIT_USERNAME: igagis
MYCI_GIT_PASSWORD: ${{ secrets.MYCI_GIT_ACCESS_TOKEN }}
jobs:
##### deb #####
deb:
strategy:
fail-fast: false
matrix:
include:
- {os: debian, codename: buster, image_owner: }
# - {os: debian, codename: buster, image_owner: i386/, labels: [i386,docker]}
- {os: debian, codename: buster, image_owner: , labels: [arm32,docker]}
- {os: debian, codename: bullseye, image_owner: }
- {os: debian, codename: bullseye, image_owner: , labels: [arm32,docker]}
- {os: debian, codename: bullseye, image_owner: , labels: [arm64,docker]}
- {os: debian, codename: bookworm, image_owner: }
- {os: debian, codename: bookworm, image_owner: , labels: [arm32,docker]}
- {os: debian, codename: bookworm, image_owner: , labels: [arm64,docker]}
# - {os: debian, codename: bookworm, image_owner: , labels: [riscv64,docker]}
- {os: ubuntu, codename: bionic, image_owner: }
- {os: ubuntu, codename: focal, image_owner: }
- {os: ubuntu, codename: jammy, image_owner: }
- {os: ubuntu, codename: noble, image_owner: }
- {os: raspbian, codename: bullseye, image_owner: igagis/, labels: [arm32,docker]}
- {os: raspbian, codename: bookworm, image_owner: igagis/, labels: [arm32,docker]}
runs-on: ${{ (matrix.labels == '' && 'ubuntu-latest') || matrix.labels }}
container: ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
name: linux - ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }} ${{ matrix.labels[0] }}
steps:
- name: install ci tools
run: |
# configure timezone to avoid 'tzdata' package to require user interaction during installation (needed for ubuntu:focal)
TZ=Europe/Helsinki ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
apt --quiet update --assume-yes
apt --quiet install --assume-yes devscripts equivs git
- name: git clone
uses: myci-actions/checkout@master
- name: install myci
run: make install
- name: set PACKAGE_VERSION
uses: myci-actions/export-env-var@master
with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh debian/changelog)}
- name: prepare debian package
run: myci-deb-prepare.sh
- name: install deps
run: myci-deb-install-build-deps.sh
- name: build
run: dpkg-buildpackage --unsigned-source --unsigned-changes
- name: deploy deb packages
run: |
echo "${{ secrets.MYCI_REPO_SSH_KEY }}" > repo_key_rsa && chmod 600 repo_key_rsa
myci-deploy-apt-ssh.sh --key repo_key_rsa --server gagis.hopto.org --repo cppfw/${{ matrix.os }} --distro ${{ matrix.codename }} --component main ../${PACKAGE_NAME}*_${PACKAGE_VERSION}_*.deb
if: startsWith(github.ref, 'refs/tags/')
##### archlinux #####
archlinux:
strategy:
fail-fast: false
matrix:
include:
- {image: "archlinux:latest", arch: amd64}
# - {image: "lopsided/archlinux-arm32v7:latest", arch: arm32, labels: [arm,docker]}
- {image: "lopsided/archlinux-arm64v8:latest", arch: arm64, labels: [arm64,docker]}
runs-on: ${{ (matrix.labels == '' && 'ubuntu-latest') || matrix.labels }}
container: ${{ matrix.image }}
name: linux - archlinux - ${{ matrix.arch }}
steps:
- name: install ci tools
run: |
pacman --sync --refresh --sysupgrade --noconfirm --noprogressbar base-devel git
- name: git clone
uses: myci-actions/checkout@master
- name: install myci
run: make install
- name: set PACKAGE_VERSION
uses: myci-actions/export-env-var@master
with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh debian/changelog)}
# makepkg needs to install dependency packages, so nobody user needs sudo rights
- name: add nobody to sudoers
run: |
echo "nobody ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
- name: build
run: |
# provide write access to user nobody
chmod --recursive 777 .
cd archlinux
sudo --user=nobody --preserve-env=PACKAGE_VERSION makepkg --syncdeps --noconfirm --skipinteg --noprogressbar
- name: deploy
run: |
echo "${{ secrets.MYCI_REPO_SSH_KEY }}" > repo_key_rsa && chmod 600 repo_key_rsa
myci-deploy-pacman-ssh.sh --server gagis.hopto.org --key repo_key_rsa --repo cppfw/archlinux/${{ matrix.arch }} --database cppfw archlinux/$PACKAGE_NAME-*-any.pkg.*
if: startsWith(github.ref, 'refs/tags/')
##### macosx #####
macosx:
runs-on: macos-latest
steps:
- name: git clone
uses: myci-actions/checkout@master
- name: install myci
run: make install
- name: install deps
run: myci-brew-install.sh `myci-list-deps-homebrew.sh`
- name: build
run: make --include-dir=$(brew --prefix)/include
- name: test
run: make --include-dir=$(brew --prefix)/include test
- name: deploy
run: myci-deploy-homebrew.sh --tap cppfw/tap
if: startsWith(github.ref, 'refs/tags/')
##### msys2 #####
msys2:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: make msys2 to provide the default shell
uses: msys2/setup-msys2@v2
with:
update: true
msystem: MSYS
install: >-
msys2-devel
make
- name: git clone
uses: myci-actions/checkout@master
- name: install myci
run: make install
- name: prepare pacman package
run: myci-apply-version.sh --version $(myci-deb-version.sh debian/changelog) msys2/PKGBUILD.in
- name: build
run: |
cd msys2
makepkg --syncdeps --noconfirm --skipinteg
- name: deploy
run: |
echo "${{ secrets.MYCI_REPO_SSH_KEY }}" > repo_key_rsa && chmod 600 repo_key_rsa
myci-deploy-pacman-ssh.sh --server gagis.hopto.org --key repo_key_rsa --repo cppfw/msys2/msys --database cppfw_msys msys2/$PACKAGE_NAME-*-any.pkg.*
if: startsWith(github.ref, 'refs/tags/')
##### mingw #####
msys2-mingw:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
strategy:
fail-fast: false
matrix:
include:
- {arch: i686, repo: mingw32}
- {arch: x86_64, repo: mingw64}
name: msys2 - ${{ matrix.repo }}
steps:
- name: make msys2 to provide the default shell
uses: msys2/setup-msys2@v2
with:
update: true
msystem: ${{ matrix.repo }}
install: >-
msys2-devel
make
diffutils
- name: add cppfw pacman msys repo
uses: myci-actions/add-pacman-repo@master
with:
name: cppfw_msys
url: http://gagis.hopto.org/repo/cppfw/msys2/msys
shell: 'msys2 {0}'
key-server: http://gagis.hopto.org/repo/cppfw/pubkey.gpg
- name: git clone
uses: myci-actions/checkout@master
- name: install myci
run: make install
- name: prepare pacman package
run: myci-apply-version.sh --version $(myci-deb-version.sh debian/changelog) msys2/PKGBUILD.in
- name: build
# to make makepkg-mingw build only one architecture we need to set the MINGW_ARCH
env: {MINGW_ARCH: '${{ matrix.repo }}'}
run: |
cd msys2
PKGEXT='.pkg.tar.xz' makepkg-mingw --syncdeps --noconfirm --skipinteg