-
-
Notifications
You must be signed in to change notification settings - Fork 86
107 lines (91 loc) · 3.57 KB
/
build.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
name: nightly build
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
with:
submodules: recursive
- name: Build
run: |
pkgver=nightly-$(date +'%Y%m%d')+$(git rev-parse --short HEAD)
echo "blesh_build_pkgver=$pkgver" >> "$GITHUB_ENV"
make FULLVER="0.4.0-nightly"
sed -i "s/^_ble_base_repository=.*/_ble_base_repository=release:$pkgver/" "out/ble.sh"
- name: Test
run: make check
- name: Package
run: |
make install INSDIR="./ble-${{ env.blesh_build_pkgver }}"
tar -cJf "ble-${{ env.blesh_build_pkgver }}.tar.xz" "ble-${{ env.blesh_build_pkgver }}"
mv "ble-${{ env.blesh_build_pkgver }}" ble-nightly
tar -cJf ble-nightly.tar.xz ble-nightly
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
ble-nightly.tar.xz
ble-${{ env.blesh_build_pkgver }}.tar.xz
tag_name: nightly
prerelease: true
body: |
## Usage
**Prerequisites**
Bash 3.0+ and basic POSIX utilities are required.
**Download ble-nightly.tar.xz**
Link kept updated for every nightly build:
${{ github.event.repository.url }}/releases/download/nightly/ble-nightly.tar.xz
Permalink to the current nightly build:
${{ github.event.repository.url }}/releases/download/nightly/ble-${{ env.blesh_build_pkgver }}.tar.xz
```bash
# DOWNLOAD with wget
wget ${{ github.event.repository.url }}/releases/download/nightly/ble-nightly.tar.xz
# DOWNLOAD with curl
curl -LO ${{ github.event.repository.url }}/releases/download/nightly/ble-nightly.tar.xz
# DOWNLOAD with wget (this specific nightly build)
wget ${{ github.event.repository.url }}/releases/download/nightly/ble-${{ env.blesh_build_pkgver }}.tar.xz
# DOWNLOAD with curl (this specific nightly build)
curl -LO ${{ github.event.repository.url }}/releases/download/nightly/ble-${{ env.blesh_build_pkgver }}.tar.xz
```
**Trial & Install**
```bash
# TRIAL
tar xJf ble-nightly.tar.xz
source ble-nightly/ble.sh
# INSTALL (quick)
tar xJf ble-nightly.tar.xz
bash ble-nightly/ble.sh --install ~/.local/share
echo 'source ~/.local/share/blesh' >> ~/.bashrc
# Note: After installation, directory ble-${{ env.blesh_build_pkgver }} can be removed.
# INSTALL (more robust)
tar xJf ble-nightly.tar.xz
bash ble-nightly/ble.sh --install ~/.local/share
# Add the following line near the top of ~/.bashrc
[[ $- == *i* ]] && source ~/.local/share/blesh/ble.sh --attach=none
# Add the following line at the end of ~/.bashrc
[[ ${BLE_VERSION-} ]] && ble-attach
# Note: After installation, directory ble-${{ env.blesh_build_pkgver }} can be removed.
```
check:
needs: build
strategy:
matrix:
os: [macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install dependencies
if: runner.os == 'macOs'
run: brew install gawk
- name: Build
run: make
- name: Test
run: make check