diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..e377f25 --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,92 @@ +name: AppImage Build +on: + workflow_dispatch: + schedule: + - cron: '30 11 * * *' # 11:30 UTC, 3:30AM Pacific + push: + branches: + - '*' +env: + ACTIONS_RUNTIME_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ACTIONS_RUNTIME_URL: ${{ env.GITHUB_SERVER_URL }}/api/actions_pipeline/ +jobs: + build-appimage: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Checkout upstream + run: | + git clone --depth=1 https://git.sr.ht/~bptato/chawan + - name: Upstream version + id: upstream-version + run: | + echo "version=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT + - name: Check for pre-existing build + id: cache + uses: actions/cache/restore@v4 + with: + lookup-only: true + key: ${{ steps.upstream-version.outputs.version }} + - name: Build AppImage + id: build + if: steps.cache.outputs.cache-hit != 'true' + run: | + apt-get update + apt-get install -y --no-install-recommends \ + ca-certificates \ + curl \ + libssh2-1-dev \ + libcurl4-openssl-dev \ + pkg-config \ + make \ + ncurses-base \ + xz-utils \ + gcc \ + git \ + file + curl https://nim-lang.org/choosenim/init.sh -OsSf + chmod 755 ./init.sh + ./init.sh -y + export PATH=$HOME/.nimble/bin:$PATH + cd chawan + make submodule + make + rm -rf /usr/local/* + make install + mkdir -p AppDir/usr + cp -R /usr/local/* AppDir/usr + sed -i -e 's#/usr#././#g' AppDir/usr/bin/cha + curl -sLO https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage + chmod 755 appimagetool-x86_64.AppImage + ./appimagetool-x86_64.AppImage --appimage-extract + cp squashfs-root/usr/bin/* /usr/local/bin/ + cp chawan.desktop AppDir + cp icon.png AppDir + cd AppDir + ln -s usr/bin/cha AppRun + cd .. + appimagetool AppDir + mv Chawan-x86_64.AppImage "Chawan-x86_64-$(git rev-parse --short HEAD).AppImage" + echo "filename=Chawan-x86_64-$(git rev-parse --short HEAD).AppImage" >> $GITHUB_OUTPUT + - name: Publish AppImage + if: steps.cache.outputs.cache-hit != 'true' + run: | + curl --user ${{ github.actor }}:${{ secrets.PACKAGE_PUSH }} \ + --upload-file ${{ runner.temp }}/${{ steps.build.outputs.filename }} \ + https://git.lerch.org/api/packages/lobo/generic/chawan-appimage/${{ steps.build.outputs.filename }} + - name: Save build + if: steps.cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: | + ${{ steps.build.outputs.filename }} + key: ${{ steps.cache.outputs.cache-primary-key }} + - name: Notify + uses: https://git.lerch.org/lobo/action-notify-ntfy@v2 + if: failure() + with: + host: ${{ secrets.NTFY_HOST }} + topic: ${{ secrets.NTFY_TOPIC }} + user: ${{ secrets.NTFY_USER }} + password: ${{ secrets.NTFY_PASSWORD }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4fd83e9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,41 @@ +FROM debian:bookworm-slim +LABEL maintainer "Emil Lerch " + +RUN apt-get update && apt-get install -y --no-install-recommends \ + ca-certificates \ + curl \ + libssh2-1-dev \ + libcurl4-openssl-dev \ + pkg-config \ + make \ + ncurses-base \ + xz-utils \ + gcc \ + git \ + && curl https://nim-lang.org/choosenim/init.sh -OsSf \ + && chmod 755 ./init.sh \ + && ./init.sh -y \ + && export PATH=$HOME/.nimble/bin:$PATH \ + && git clone --depth=1 https://git.sr.ht/~bptato/chawan \ + && cd chawan \ + && make submodule \ + && make \ + && make install \ + && mkdir -p /AppDir/usr \ + && cp -R /usr/local/* /AppDir/usr \ + && sed -i -e 's#/usr#././#g' /AppDir/usr/bin/cha \ + && curl -sLO https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage \ + && chmod 755 appimagetool-x86_64.AppImage \ + && ./appimagetool-x86_64.AppImage --appimage-extract \ + && cp squashfs-root/usr/bin/* /usr/local/bin/ \ + && apt-get install -y file \ + && cd /AppDir \ + && ln -s usr/bin/cha AppRun + +COPY chawan.desktop /AppDir/ +COPY icon.png /AppDir/ + +RUN appimagetool /AppDir + +# /Chawan-x86_64.AppImage +#ENTRYPOINT [ "aws" ] diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..506dadd --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Emil Lerch + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..10484dc --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +AppImage Builder for Chawan Web Browser +======================================= + +This builds AppImages for [Chawan](https://sr.ht/~bptato/chawan/). Images are published in the packages directory. + +A dockerfile used for testing is in the root directory, but the real work is done as a GitHub action. + +The icon is just some public domain thing as the project has no icon. diff --git a/chawan.desktop b/chawan.desktop new file mode 100644 index 0000000..118dc65 --- /dev/null +++ b/chawan.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Name=Chawan +Exec=cha +Icon=icon +Type=Application +Categories=Network +Terminal=true diff --git a/icon.png b/icon.png new file mode 100644 index 0000000..f2d8c19 Binary files /dev/null and b/icon.png differ