| 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@v4 |
| 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@v2 |
| 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.html_url }}/releases/download/nightly/ble-nightly.tar.xz |
| 49 | |
| 50 | Permalink to the current nightly build: |
| 51 | |
| 52 | ${{ github.event.repository.html_url }}/releases/download/nightly/ble-${{ env.blesh_build_pkgver }}.tar.xz |
| 53 | |
| 54 | ```bash |
| 55 | # DOWNLOAD with wget |
| 56 | wget ${{ github.event.repository.html_url }}/releases/download/nightly/ble-nightly.tar.xz |
| 57 | |
| 58 | # DOWNLOAD with curl |
| 59 | curl -LO ${{ github.event.repository.html_url }}/releases/download/nightly/ble-nightly.tar.xz |
| 60 | |
| 61 | # DOWNLOAD with wget (this specific nightly build) |
| 62 | wget ${{ github.event.repository.html_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.html_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-nightly/ble.sh |
| 74 | |
| 75 | # INSTALL (quick) |
| 76 | tar xJf ble-nightly.tar.xz |
| 77 | bash ble-nightly/ble.sh --install ~/.local/share |
| 78 | echo 'source ~/.local/share/blesh' >> ~/.bashrc |
| 79 | # Note: After installation, directory ble-nightly can be removed. |
| 80 | |
| 81 | # INSTALL (more robust) |
| 82 | tar xJf ble-nightly.tar.xz |
| 83 | bash ble-nightly/ble.sh --install ~/.local/share |
| 84 | # Add the following line near the top of ~/.bashrc |
| 85 | [[ $- == *i* ]] && source ~/.local/share/blesh/ble.sh --attach=none |
| 86 | # Add the following line at the end of ~/.bashrc |
| 87 | [[ ! ${BLE_VERSION-} ]] || ble-attach |
| 88 | # Note: After installation, directory ble-nightly can be removed. |
| 89 | ``` |
| 90 | |
| 91 | If you try to install `ble-nightly-20240223+8f0dfe9` or an older version, please directly copy or rename the extracted directory to `~/.local/share/blesh`. The option `--install` is not implemented. |
| 92 | check: |
| 93 | needs: build |
| 94 | strategy: |
| 95 | matrix: |
| 96 | os: [macos-latest, windows-latest] |
| 97 | runs-on: ${{ matrix.os }} |
| 98 | steps: |
| 99 | - name: Check out |
| 100 | uses: actions/checkout@v4 |
| 101 | with: |
| 102 | submodules: recursive |
| 103 | - name: Install dependencies |
| 104 | if: runner.os == 'macOs' |
| 105 | run: brew install gawk |
| 106 | - name: Build |
| 107 | run: make |
| 108 | - name: Test |
| 109 | run: make check |