diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index 5c59626..7aeba44 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -19,7 +19,7 @@ jobs: dockerfile: ./frontend/Dockerfile image: focus-frontend - context: . - image: focu + image: focus env: RUNNER_TOOL_CACHE: /toolcaches steps: @@ -107,6 +107,81 @@ jobs: name: Focus ${{ steps.tagName.outputs.tag }} prerelease: true files: |- - frontend/src-tauri/target/release/focus + frontend/src-tauri/target/release/focus-desktop frontend/src-tauri/target/release/bundle/deb/*.deb frontend/src-tauri/target/release/bundle/appimage/*.AppImage + + - name: Generate sha256sum + run: | + mkdir -p ./ci/pkgbuild/desktop-bin + sha256 frontend/src-tauri/target/release/bundle/deb/*.deb > ./ci/pkgbuild/desktop-bin/sha256sum + + - name: Generate PKGBUILD + env: + RELEASE_TAG: ${{ steps.tagName.outputs.tag }} + run: ./ci/generate-pkgbuild-desktop.py + + - name: Publish AUR package + uses: KSXGitHub/github-actions-deploy-aur@v2.7.0 + with: + pkgname: focus-desktop-bin + pkgbuild: ./ci/pkgbuild/desktop-bin/PKGBUILD + commit_username: ${{ secrets.AUR_USERNAME }} + commit_email: ${{ secrets.AUR_EMAIL }} + ssh_private_key: ${{ secrets.AUR_SSH_KEY }} + commit_message: Update focus-desktop-bin to ${{ steps.tagName.outputs.tag }} + + build-server: + runs-on: ubuntu-latest + container: + image: catthehacker/ubuntu:act-latest + env: + RUNNER_TOOL_CACHE: /toolcache + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Extract tag + uses: olegtarasov/get-tag@v2.1.2 + id: tagName + with: + tagRegex: "v(.*)" + + - name: Set up go + uses: actions/setup-go@v3 + with: + go-version: 1.21.5 + + - name: Build server + run: | + cd backend + go build -o focus-server . + cd .. + + - name: Publish server + uses: akkuman/gitea-release-action@v1 + with: + name: Focus ${{ steps.tagName.outputs.tag }} + prerelease: true + files: |- + backend/focus-server + + - name: Generate sha256sum + run: | + mkdir -p ./ci/pkgbuild/server-bin + sha256 backend/focus-server > ./ci/pkgbuild/server-bin/sha256sum + + - name: Generate PKGBUILD + env: + RELEASE_TAG: ${{ steps.tagName.outputs.tag }} + run: ./ci/generate-pkgbuild-server.py + + - name: Publish AUR package + uses: KSXGitHub/github-actions-deploy-aur@v2.7.0 + with: + pkgname: focus-server-bin + pkgbuild: ./ci/pkgbuild/server-bin/PKGBUILD + commit_username: ${{ secrets.AUR_USERNAME }} + commit_email: ${{ secrets.AUR_EMAIL }} + ssh_private_key: ${{ secrets.AUR_SSH_KEY }} + commit_message: Update focus-server-bin to ${{ steps.tagName.outputs.tag }} diff --git a/README.md b/README.md index 1a330a5..a370e6e 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ yay -S focus-desktop-bin # Desktop app yay -S focus-server-git # Server ``` -The server can then be started with `focus-server` or `systemctl start focus-server.service`. +The server can then be started with `focus-server` or `systemctl start focus-server.service` and the client with `focus`. ### Debug Mode diff --git a/backend/PKGBUILD b/backend/PKGBUILD deleted file mode 100644 index df28078..0000000 --- a/backend/PKGBUILD +++ /dev/null @@ -1,39 +0,0 @@ -# Maintainer: Brieuc Dubois -pkgname=focus-server-git -pkgver=r$(git rev-list --count HEAD).$(git rev-parse --short HEAD) -pkgrel=1 -pkgdesc="Focus is an open-source, Kanban-style project management tool, emphasizing simplicity and efficiency." -arch=('x86_64') -license=('MIT') -provides=("${pkgname%-git}=${pkgver}") -conflicts=("${pkgname%-git}") -url="https://git.bhasher.com/bhasher/focus" - -source=( - "$pkgname::git+https://git.bhasher.com/bhasher/focus.git" - "LICENSE::https://git.bhasher.com/Bhasher/focus/raw/branch/master/LICENSE.md" -) -md5sums=( - 'SKIP' - 'SKIP' -) - -depends=( - 'glibc' -) -makedepends=( - 'go' - 'git' -) - -build() { - cd "$srcdir/$pkgname/backend" - CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o focus-server . -} - -package() { - install -Dm755 "${srcdir}/${pkgname}/backend/focus-server" "${pkgdir}/usr/bin/focus-server" - install -Dm644 "${srcdir}/${pkgname}/backend/focus-server.service" "${pkgdir}/usr/lib/systemd/system/focus-server.service" - install -Dm644 "${srcdir}/${pkgname}/LICENSE.md" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" -} - diff --git a/ci/generate-pkgbuild-desktop.py b/ci/generate-pkgbuild-desktop.py new file mode 100644 index 0000000..b1e0080 --- /dev/null +++ b/ci/generate-pkgbuild-desktop.py @@ -0,0 +1,68 @@ +#! /usr/bin/env python3 +from os import environ + +release_tag = environ.get('RELEASE_TAG') +if not release_tag: + print('::error ::RELEASE_TAG not set') + exit(1) + +# TODO +with open('./ci/pkgbuild/desktop-bin/sha256sum', 'r') as f: + sha256sum = f.read().strip() +if not sha256sum: + print('::error ::sha256sum not set') + exit(1) + +pkgbuild = f'''\ + # Maintainer: Brieuc Dubois + pkgname=focus-desktop-bin + pkgver={release_tag} + pkgrel=1 + pkgdesc="Focus is an open-source, Kanban-style project management tool, emphasizing simplicity and efficiency." + arch=('x86_64') + url="https://git.bhasher.com/bhasher/focus" + license=('MIT') + + provides=("${{pkgname%-bin}}=${{pkgver}}") + conflicts=("${{pkgname%-bin}}") + + depends=( + 'webkit2gtk' + 'gtk3' + 'cairo' + 'glib2' + 'hicolor-icon-theme' + 'gdk-pixbuf2' + 'libsoup' + 'gcc-libs' + 'glibc' + 'pango' + ) + + source=( + "focus-desktop_${{pkgver}}_amd64.deb::https://git.bhasher.com/Bhasher/focus/releases/download/v${{pkgver}}/focus-desktop_${{pkgver}}_amd64.deb" + "LICENSE::https://git.bhasher.com/Bhasher/focus/raw/branch/master/LICENSE.md" + ) + + sha256sums=( + '{sha256sum}' + 'SKIP' + ) + + build() {{ + bsdtar -xf "${{srcdir}}/data.tar.gz" + }} + + package() {{ + install -Dm755 "${{srcdir}}/usr/bin/focus-desktop" "${{pkgdir}}/usr/bin/focus-desktop" + install -Dm644 "${{srcdir}}/usr/share/applications/focus-desktop.desktop" "${{pkgdir}}/usr/share/applications/focus-desktop.desktop" + for _icons in 32x32 128x128 256x256@2;do + install -Dm644 "${{srcdir}}/usr/share/icons/hicolor/${{_icons}}/apps/focus-desktop.png" \ + -t "${{pkgdir}}/usr/share/icons/hicolor/${{_icons//@2/}}/apps/focus-desktop.png" + done + install -Dm644 "${{srcdir}}/LICENSE" "${{pkgdir}}/usr/share/licenses/${{pkgname}}/LICENSE" + }} +''' + +with open('./ci/pkgbuild/desktop-bin/PKGBUILD', 'w') as f: + f.write(pkgbuild) \ No newline at end of file diff --git a/ci/generate-pkgbuild-server-bin.py b/ci/generate-pkgbuild-server-bin.py new file mode 100644 index 0000000..84de7d1 --- /dev/null +++ b/ci/generate-pkgbuild-server-bin.py @@ -0,0 +1,50 @@ +#! /usr/bin/env python3 +from os import environ + +release_tag = environ.get('RELEASE_TAG') +if not release_tag: + print('::error ::RELEASE_TAG not set') + exit(1) + +# TODO +with open('./ci/pkgbuild/server-bin/sha256sum', 'r') as f: + sha256sum = f.read().strip() +if not sha256sum: + print('::error ::sha256sum not set') + exit(1) + +pkgbuild = f'''\ + # Maintainer: Brieuc Dubois + pkgname=focus-server-bin + pkgver={release_tag} + pkgrel=1 + pkgdesc="Focus is an open-source, Kanban-style project management tool, emphasizing simplicity and efficiency." + arch=('x86_64') + url="https://git.bhasher.com/bhasher/focus" + license=('MIT') + + provides=("${{pkgname%-bin}}=${{pkgver}}") + conflicts=("${{pkgname%-bin}}") + + depends=( + 'glibc' + ) + + source=( + "focus-server::https://git.bhasher.com/Bhasher/focus/releases/download/v${{pkgver}}/focus-server" + "LICENSE::https://git.bhasher.com/Bhasher/focus/raw/branch/master/LICENSE.md" + ) + + sha256sums=( + '{sha256sum}' + 'SKIP' + ) + + package() {{ + install -Dm755 "${{srcdir}}/focus-server" "${{pkgdir}}/usr/bin/focus-server" + install -Dm644 "${{srcdir}}/LICENSE" "${{pkgdir}}/usr/share/licenses/${{pkgname}}/LICENSE" + }} +''' + +with open('./ci/pkgbuild/server-bin/PKGBUILD', 'w') as f: + f.write(pkgbuild) \ No newline at end of file diff --git a/frontend/src-tauri/PKGBUILD b/frontend/src-tauri/PKGBUILD deleted file mode 100644 index 84874ba..0000000 --- a/frontend/src-tauri/PKGBUILD +++ /dev/null @@ -1,48 +0,0 @@ -# Maintainer: Brieuc Dubois -pkgname=focus-desktop-bin -pkgver=0.3.2 -pkgrel=1 -pkgdesc="Focus is an open-source, Kanban-style project management tool, emphasizing simplicity and efficiency." -arch=('x86_64') -license=('MIT') -provides=("${pkgname%-bin}=${pkgver}") -conflicts=("${pkgname%-bin}") -url="https://git.bhasher.com/bhasher/focus" - -depends=( - 'webkit2gtk' - 'gtk3' - 'cairo' - 'glib2' - 'hicolor-icon-theme' - 'gdk-pixbuf2' - 'libsoup' - 'gcc-libs' - 'glibc' - 'pango' -) - -source=( - "https://git.bhasher.com/Bhasher/focus/releases/download/v${pkgver}/focus_${pkgver}_amd64.deb" - "LICENSE-${pkgver}::https://git.bhasher.com/Bhasher/focus/raw/branch/master/LICENSE.md" -) - -sha256sums=( - '64dc3fbd2476ef5ff9b0705c6ec287657ef7ce96c4b72d063088eb05c519f227' - '00f70f9c4cb1c351877b690002c21564dc022f7b5d7fd1273ff52c5911356384' -) - -build() { - bsdtar -xf "${srcdir}/data.tar.gz" -} - -package() { - install -Dm755 "${srcdir}/usr/bin/focus" "${pkgdir}/usr/bin/focus" - install -Dm644 "${srcdir}/usr/share/applications/focus.desktop" "${pkgdir}/usr/share/applications" - for _icons in 32x32 128x128 256x256@2;do - install -Dm644 "${srcdir}/usr/share/icons/hicolor/${_icons}/apps/focus.png" \ - -t "${pkgdir}/usr/share/icons/hicolor/${_icons//@2/}/apps" - done - install -Dm644 "${srcdir}/LICENSE-${pkgver}" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" -} - diff --git a/frontend/src-tauri/tauri.conf.json b/frontend/src-tauri/tauri.conf.json index 748da85..2b3579c 100644 --- a/frontend/src-tauri/tauri.conf.json +++ b/frontend/src-tauri/tauri.conf.json @@ -8,8 +8,8 @@ "withGlobalTauri": true }, "package": { - "productName": "Focus", - "version": "0.3.2" + "productName": "Focus-Desktop", + "version": "0.3.3" }, "tauri": { "allowlist": {