-
Notifications
You must be signed in to change notification settings - Fork 12
86 lines (73 loc) · 2.66 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
name: CI
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 4 1 * *'
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
# don't run pull requests from local branches twice
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
fail-fast: false
matrix:
include:
- name: macOS
os: macos-latest
android-dir: Library/Android
- name: Linux
os: ubuntu-latest
android-dir: Android
steps:
- uses: actions/checkout@v3
- name: Install packages
run: |
if [ "$RUNNER_OS" = "macOS" ]; then
brew install cmake autoconf automake libtool pkg-config
elif [ "$RUNNER_OS" = "Linux" ]; then
sudo apt-get install curl cmake make libtool pkg-config texinfo python3-distutils
# install autoconf 2.71 from source (required by libffi, not available via apt-get on Ubuntu focal)
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.xz
tar -xf autoconf-2.71.tar.xz
cd autoconf-2.71 && ./configure --prefix=/usr/ && make && sudo make install
autoconf --version
wget http://ftp.gnu.org/gnu/automake/automake-1.16.4.tar.xz
tar -xf automake-1.16.4.tar.xz
cd automake-1.16.4 && ./configure --prefix=/usr/ && make && sudo make install
automake --version
else
echo Unsupported OS $RUNNER_OS
exit 1
fi
- name: Build toolchain
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./build.sh --ndk $ANDROID_NDK_LATEST_HOME --dist-root HOME/${{matrix.android-dir}}/GNUstep
- name: Package build
run: |
tar -a -cf GNUstep-Android-${{matrix.name}}.tar.xz -C$HOME/${{matrix.android-dir}} GNUstep
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
path: GNUstep-Android-${{matrix.name}}.tar.xz
name: GNUstep-Android-${{matrix.name}}
prerelease:
needs: build
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master' }}
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Update GitHub prerelease
if: ${{ github.ref == 'refs/heads/master' }}
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: latest
prerelease: true
title: "Latest Build"
files: "**/GNUstep-Android-*.tar.xz"