build.yml (3594B)
1 name: nightly build 2 on: 3 push: 4 branches: 5 - master 6 7 jobs: 8 build: 9 runs-on: ubuntu-latest 10 steps: 11 - name: Check out 12 uses: actions/checkout@v3 13 with: 14 submodules: recursive 15 - name: Build 16 run: | 17 pkgver=nightly-$(date +'%Y%m%d')+$(git rev-parse --short HEAD) 18 echo "blesh_build_pkgver=$pkgver" >> "$GITHUB_ENV" 19 make FULLVER="0.4.0-nightly" 20 sed -i "s/^_ble_base_repository=.*/_ble_base_repository=release:$pkgver/" "out/ble.sh" 21 - name: Test 22 run: make check 23 - name: Package 24 run: | 25 make install INSDIR="./ble-${{ env.blesh_build_pkgver }}" 26 tar -cJf "ble-${{ env.blesh_build_pkgver }}.tar.xz" "ble-${{ env.blesh_build_pkgver }}" 27 mv "ble-${{ env.blesh_build_pkgver }}" ble-nightly 28 tar -cJf ble-nightly.tar.xz ble-nightly 29 - name: Release 30 uses: softprops/action-gh-release@v1 31 with: 32 files: | 33 ble-nightly.tar.xz 34 ble-${{ env.blesh_build_pkgver }}.tar.xz 35 tag_name: nightly 36 prerelease: true 37 body: | 38 ## Usage 39 40 **Prerequisites** 41 42 Bash 3.0+ and basic POSIX utilities are required. 43 44 **Download ble-nightly.tar.xz** 45 46 Link kept updated for every nightly build: 47 48 ${{ github.event.repository.url }}/releases/download/nightly/ble-nightly.tar.xz 49 50 Permalink to the current nightly build: 51 52 ${{ github.event.repository.url }}/releases/download/nightly/ble-${{ env.blesh_build_pkgver }}.tar.xz 53 54 ```bash 55 # DOWNLOAD with wget 56 wget ${{ github.event.repository.url }}/releases/download/nightly/ble-nightly.tar.xz 57 58 # DOWNLOAD with curl 59 curl -LO ${{ github.event.repository.url }}/releases/download/nightly/ble-nightly.tar.xz 60 61 # DOWNLOAD with wget (this specific nightly build) 62 wget ${{ github.event.repository.url }}/releases/download/nightly/ble-${{ env.blesh_build_pkgver }}.tar.xz 63 64 # DOWNLOAD with curl (this specific nightly build) 65 curl -LO ${{ github.event.repository.url }}/releases/download/nightly/ble-${{ env.blesh_build_pkgver }}.tar.xz 66 ``` 67 68 **Trial & Install** 69 70 ```bash 71 # TRIAL 72 tar xJf ble-nightly.tar.xz 73 source ble-${{ env.blesh_build_pkgver }}/ble.sh 74 75 # INSTALL (quick) 76 tar xJf ble-nightly.tar.xz 77 mkdir -p ~/.local/share/blesh 78 cp -fR ble-${{ env.blesh_build_pkgver }}/* ~/.local/share/blesh/ 79 echo 'source ~/.local/share/blesh' >> ~/.bashrc 80 81 # INSTALL (more robust) 82 tar xJf ble-nightly.tar.xz 83 mkdir -p ~/.local/share/blesh 84 cp -fR ble-${{ env.blesh_build_pkgver }}/* ~/.local/share/blesh/ 85 # Add the following line near the top of ~/.bashrc 86 [[ $- == *i* ]] && source ~/.local/share/blesh/ble.sh --attach=none 87 # Add the following line at the end of ~/.bashrc 88 [[ ${BLE_VERSION-} ]] && ble-attach 89 ``` 90 check: 91 needs: build 92 strategy: 93 matrix: 94 os: [macos-latest, windows-latest] 95 runs-on: ${{ matrix.os }} 96 steps: 97 - name: Check out 98 uses: actions/checkout@v3 99 with: 100 submodules: recursive 101 - name: Install dependencies 102 if: runner.os == 'macOs' 103 run: brew install gawk 104 - name: Build 105 run: make 106 - name: Test 107 run: make check