diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f150c50 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,84 @@ +name: Release & Publish to AUR + +on: + push: + branches: + - main + +permissions: + contents: write + +jobs: + check-version: + runs-on: ubuntu-latest + outputs: + version: ${{ steps.version.outputs.version }} + tag_exists: ${{ steps.check_tag.outputs.exists }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Read version + id: version + run: echo "version=$(cat VERSION | tr -d '[:space:]')" >> $GITHUB_OUTPUT + + - name: Check if tag exists + id: check_tag + run: | + if git rev-parse "v${{ steps.version.outputs.version }}" >/dev/null 2>&1; then + echo "exists=true" >> $GITHUB_OUTPUT + else + echo "exists=false" >> $GITHUB_OUTPUT + fi + + release: + runs-on: ubuntu-latest + needs: check-version + if: needs.check-version.outputs.tag_exists == 'false' + steps: + - uses: actions/checkout@v4 + + - name: Create tag + run: | + git config user.name "github-actions" + git config user.email "github-actions@github.com" + git tag "v${{ needs.check-version.outputs.version }}" + git push origin "v${{ needs.check-version.outputs.version }}" + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + tag_name: "v${{ needs.check-version.outputs.version }}" + generate_release_notes: true + + aur-publish: + runs-on: ubuntu-latest + needs: [check-version, release] + if: needs.check-version.outputs.tag_exists == 'false' + steps: + - uses: actions/checkout@v4 + + - name: Compute source checksum + id: checksum + run: | + VERSION=${{ needs.check-version.outputs.version }} + curl -sL "https://github.com/${{ github.repository }}/archive/v${VERSION}.tar.gz" -o source.tar.gz + echo "sha256=$(sha256sum source.tar.gz | cut -d' ' -f1)" >> $GITHUB_OUTPUT + + - name: Generate PKGBUILD from template + run: | + sed -e 's/{{VERSION}}/${{ needs.check-version.outputs.version }}/g' \ + -e 's/{{SHA256}}/${{ steps.checksum.outputs.sha256 }}/g' \ + PKGBUILD.template > PKGBUILD + + - name: Publish to AUR + uses: KSXGitHub/github-actions-deploy-aur@v4.1.2 + with: + pkgname: quick-visor + pkgbuild: ./PKGBUILD + commit_username: Alex Macocian + commit_email: amacocian@yahoo.com + ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} + commit_message: "Update to ${{ needs.check-version.outputs.version }}" + force_push: true diff --git a/PKGBUILD b/PKGBUILD deleted file mode 100644 index b778f8c..0000000 --- a/PKGBUILD +++ /dev/null @@ -1,23 +0,0 @@ -# Maintainer: Alex Macocian -pkgname=quick-visor -pkgver=0.0.1 -pkgrel=1 -pkgdesc="Quickshell-based display manager overlay for Hyprland" -arch=('any') -url="https://git.estatecloud.org/radumaco/quick-visor" -license=('MIT') -depends=('quickshell' 'qt6-declarative' 'hyprland') -source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz") -sha256sums=('SKIP') - -package() { - cd "$srcdir/$pkgname" - - install -dm755 "$pkgdir/usr/share/$pkgname" - install -m644 qml/* "$pkgdir/usr/share/$pkgname/" - - install -Dm755 bin/quick-visor "$pkgdir/usr/bin/quick-visor" - install -Dm755 bin/quick-visor-toggle "$pkgdir/usr/bin/quick-visor-toggle" - - install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md" -} diff --git a/PKGBUILD.template b/PKGBUILD.template new file mode 100644 index 0000000..27033d8 --- /dev/null +++ b/PKGBUILD.template @@ -0,0 +1,29 @@ +# Maintainer: Alex Macocian +pkgname=quick-visor +pkgver={{VERSION}} +pkgrel=1 +pkgdesc="Quickshell-based display manager overlay for Hyprland" +arch=('any') +url="https://github.com/AlexMacocian/quick-visor" +license=('MIT') +depends=( + 'quickshell' + 'qt6-declarative' + 'hyprland' + 'inotify-tools' +) +source=("${pkgname}-${pkgver}.tar.gz::https://github.com/AlexMacocian/quick-visor/archive/v${pkgver}.tar.gz") +sha256sums=('{{SHA256}}') + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + + install -dm755 "${pkgdir}/usr/share/quickshell/${pkgname}" + install -m644 qml/* "${pkgdir}/usr/share/quickshell/${pkgname}/" + + install -Dm755 bin/quick-visor "${pkgdir}/usr/bin/quick-visor" + install -Dm755 bin/quick-visor-toggle "${pkgdir}/usr/bin/quick-visor-toggle" + + install -Dm644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md" + install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" +} diff --git a/README.md b/README.md index a5eecb3..6ffe04a 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,12 @@ A Quickshell-based display manager overlay for Hyprland. ## Usage +Install from the AUR: + +```sh +paru -S quick-visor +``` + Start the resident Quickshell instance once per session: ```conf diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..8acdd82 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.0.1 diff --git a/bin/quick-visor b/bin/quick-visor index 7ab6693..2ca5a77 100755 --- a/bin/quick-visor +++ b/bin/quick-visor @@ -1,3 +1,3 @@ #!/bin/sh # Launches the quick-visor Quickshell instance. Run once at session start. -exec quickshell -n -p /usr/share/quick-visor/shell.qml "$@" +exec quickshell -n -p /usr/share/quickshell/quick-visor/shell.qml "$@" diff --git a/bin/quick-visor-toggle b/bin/quick-visor-toggle index 4e96760..1d0f061 100755 --- a/bin/quick-visor-toggle +++ b/bin/quick-visor-toggle @@ -1,3 +1,3 @@ #!/bin/sh # Toggle the quick-visor overlay from a compositor keybinding. -exec quickshell ipc -p /usr/share/quick-visor/shell.qml call quick-visor toggle +exec quickshell ipc -p /usr/share/quickshell/quick-visor/shell.qml call quick-visor toggle