Skip to content

Commit

Permalink
Add PKGBUILD stable and -git, AUR publish and Arch build GitHub Actio…
Browse files Browse the repository at this point in the history
…ns (#31)

* Create AUR_publish.yml

* Added PKGBUILD

* Switched AUR publish addon

* Added arch-build action

* Remove useless step in arch-build

* Checkout latest tag instead of master for Arch and Fedora publish actions

* Added -git PKGBUILD and added wlroots < 0.16 as dependency

* Checkout master before running swayfx-git aur script

* Check build for stable PKGBUILD after -git version

* Removed spaces in wlroots depends version
  • Loading branch information
ErikReider authored Nov 13, 2022
1 parent c82adeb commit 7990b32
Show file tree
Hide file tree
Showing 10 changed files with 324 additions and 2 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/AUR_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Package for the AUR

on:
release:
types: [published]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
aur-publish:
runs-on: ubuntu-latest
steps:
- name: Check out sources
uses: actions/checkout@v3
with:
fetch-depth: 0
# Checks out the latest tag
- run: |
git stash save "Action stashing changes"
latestTag=$(git describe --abbrev=0 --tags)
git checkout $latestTag
- name: Publish AUR Stable package
uses: ulises-jeremias/github-actions-aur-publish@v1
with:
pkgname: swayfx
pkgbuild: ./build-scripts/aur/PKGBUILD
assets: |
./build-scripts/aur/50-systemd-user.conf
./build-scripts/aur/sway.install
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: Update AUR package
ssh_keyscan_types: rsa,dsa,ecdsa,ed25519
update_pkgver: false

# Checks out the the Master branch
- run: |
git checkout master
- name: Publish AUR -git package
uses: ulises-jeremias/github-actions-aur-publish@v1
with:
pkgname: swayfx-git
pkgbuild: ./build-scripts/aur-git/PKGBUILD
assets: |
./build-scripts/aur-git/50-systemd-user.conf
./build-scripts/aur-git/sway.install
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: Update AUR package
ssh_keyscan_types: rsa,dsa,ecdsa,ed25519
update_pkgver: false
35 changes: 35 additions & 0 deletions .github/workflows/arch-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Check build for Arch.

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
arch-build:
container: archlinux:latest
runs-on: ubuntu-latest

steps:
# It is necessary to checkout into sub-directory, because of some weird ownership problems cause by using containers
- name: Check out sources
uses: actions/checkout@v3
with:
fetch-depth: 0
path: swayfx

- name: Git makepkg build and check
id: makepkg
uses: edlanglois/pkgbuild-action@v1
with:
pkgdir: ./swayfx/build-scripts/aur-git

- name: Stable makepkg build and check
id: makepkg
uses: edlanglois/pkgbuild-action@v1
with:
pkgdir: ./swayfx/build-scripts/aur
2 changes: 1 addition & 1 deletion .github/workflows/fedora-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
workflow_dispatch:

jobs:
package:
fedora-build:
container: fedora:37
runs-on: ubuntu-latest

Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/fedora-copr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch:

jobs:
package:
fedora-copr:
container: fedora:latest
runs-on: ubuntu-latest

Expand All @@ -31,6 +31,12 @@ jobs:
with:
fetch-depth: 0
path: swayfx
# Checks out the latest tag
- run: |
cd swayfx
git stash save "Action stashing changes"
latestTag=$(git describe --abbrev=0 --tags)
git checkout $latestTag
- name: Copy spec into root dir
run: |
Expand Down
7 changes: 7 additions & 0 deletions build-scripts/aur-git/50-systemd-user.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# sway does not set DISPLAY/WAYLAND_DISPLAY in the systemd user environment
# See FS#63021
# Adapted from xorg's 50-systemd-user.sh, which achieves a similar goal.

exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP
exec hash dbus-update-activation-environment 2>/dev/null && \
dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP
78 changes: 78 additions & 0 deletions build-scripts/aur-git/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Maintainer: Erik Reider <erik.reider@protonmail.com>
_pkgname=swayfx
pkgname="$_pkgname-git"
pkgver=r6905.e2ef3ceb
pkgrel=1
license=("MIT")
pkgdesc="SwayFX: Sway, but with eye candy!"
makedepends=(
"git"
"meson"
"scdoc"
"wayland-protocols"
)
depends=(
"cairo"
"gdk-pixbuf2"
"libevdev.so"
"libinput"
"libjson-c.so"
"libudev.so"
"libwayland-server.so"
"libwlroots.so"
"libxcb"
"libxkbcommon.so"
"pango"
"pcre"
"ttf-font"
"wlroots<0.16"
)
optdepends=(
"alacritty: Terminal emulator used by the default config"
"dmenu: Application launcher"
"grim: Screenshot utility"
"i3status: Status line"
"mako: Lightweight notification daemon"
"slurp: Select a region"
"swayidle: Idle management daemon"
"swaylock: Screen locker"
"wallutils: Timed wallpapers"
"waybar: Highly customizable bar"
)
backup=(etc/sway/config)
arch=("i686" "x86_64")
url="https://github.com/WillPower3309/swayfx"
source=("${pkgname%-*}::git+${url}.git"
50-systemd-user.conf)
sha512sums=(
"SKIP"
"c2b7d808f4231f318e03789015624fd4cf32b81434b15406570b4e144c0defc54e216d881447e6fd9fc18d7da608cccb61c32e0e1fab2f1fe2750acf812d3137")
provides=("sway" "swayfx")
conflicts=("sway" "swayfx")
options=(debug)
install=sway.install

pkgver() {
cd "$_pkgname"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
arch-meson \
-Dsd-bus-provider=libsystemd \
-Dwerror=false \
"$_pkgname" build
meson compile -C build
}

package() {
install -Dm644 50-systemd-user.conf -t "$pkgdir/etc/sway/config.d/"

DESTDIR="$pkgdir" meson install -C build

cd "$_pkgname"
install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
for util in autoname-workspaces.py inactive-windows-transparency.py grimshot; do
install -Dm755 "contrib/$util" -t "$pkgdir/usr/share/$pkgname/scripts"
done
}
31 changes: 31 additions & 0 deletions build-scripts/aur-git/sway.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
post_install() {
cat << EOD
Sway requires additional setup for privilege escalation. Without this setup,
sway will fail to start with session activation permission failures. Choose one
of the two available options (In alphabetical, not recommended, order):

1. polkit: This will make sway "just work" right after installation but may be
a weightier solution than desired.

2. seatd: Already required as a sway dependency, this is a lighter-weight
solution but requires some user configuration: Enabling the service,
adding your user to the "seat" group, then logging out/in again.

Either option should provide the same functionality/stability. Refer to the
Sway wiki page for information.
EOD
}

post_upgrade() {
cat << EOD
Sway's necessary privileges can now be obtained through seatd as well as the
incumbent polkit package. As such, polkit has been relegated to an optional
dependency.

Note that using seatd instead of polkit means that a user must be a part of the
"seat" group: Otherwise, the user will not be able to achieve the appropriate
privileged actions.

For more information, refer to the Sway wiki page.
EOD
}
7 changes: 7 additions & 0 deletions build-scripts/aur/50-systemd-user.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# sway does not set DISPLAY/WAYLAND_DISPLAY in the systemd user environment
# See FS#63021
# Adapted from xorg's 50-systemd-user.sh, which achieves a similar goal.

exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP
exec hash dbus-update-activation-environment 2>/dev/null && \
dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP
73 changes: 73 additions & 0 deletions build-scripts/aur/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Maintainer: Erik Reider <erik.reider@protonmail.com>
_pkgname=swayfx
pkgname="$_pkgname"
pkgver=0.1
pkgrel=1
license=("MIT")
pkgdesc="SwayFX: Sway, but with eye candy!"
makedepends=(
"git"
"meson"
"scdoc"
"wayland-protocols"
)
depends=(
"cairo"
"gdk-pixbuf2"
"libevdev.so"
"libinput"
"libjson-c.so"
"libudev.so"
"libwayland-server.so"
"libwlroots.so"
"libxcb"
"libxkbcommon.so"
"pango"
"pcre"
"ttf-font"
"wlroots<0.16"
)
optdepends=(
"alacritty: Terminal emulator used by the default config"
"dmenu: Application launcher"
"grim: Screenshot utility"
"i3status: Status line"
"mako: Lightweight notification daemon"
"slurp: Select a region"
"swayidle: Idle management daemon"
"swaylock: Screen locker"
"wallutils: Timed wallpapers"
"waybar: Highly customizable bar"
)
backup=(etc/sway/config)
arch=("i686" "x86_64")
url="https://github.com/WillPower3309/swayfx"
source=("${url}/releases/download/$pkgver/swayfx-$pkgver.tar.gz"
50-systemd-user.conf)
sha512sums=(
"SKIP"
"c2b7d808f4231f318e03789015624fd4cf32b81434b15406570b4e144c0defc54e216d881447e6fd9fc18d7da608cccb61c32e0e1fab2f1fe2750acf812d3137")
provides=("sway" "swayfx")
conflicts=("sway" "swayfx")
options=(debug)
install=sway.install

build() {
arch-meson \
-Dsd-bus-provider=libsystemd \
-Dwerror=false \
"$_pkgname" build
meson compile -C build
}

package() {
install -Dm644 50-systemd-user.conf -t "$pkgdir/etc/sway/config.d/"

DESTDIR="$pkgdir" meson install -C build

cd "$_pkgname"
install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
for util in autoname-workspaces.py inactive-windows-transparency.py grimshot; do
install -Dm755 "contrib/$util" -t "$pkgdir/usr/share/$pkgname/scripts"
done
}
31 changes: 31 additions & 0 deletions build-scripts/aur/sway.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
post_install() {
cat << EOD
Sway requires additional setup for privilege escalation. Without this setup,
sway will fail to start with session activation permission failures. Choose one
of the two available options (In alphabetical, not recommended, order):

1. polkit: This will make sway "just work" right after installation but may be
a weightier solution than desired.

2. seatd: Already required as a sway dependency, this is a lighter-weight
solution but requires some user configuration: Enabling the service,
adding your user to the "seat" group, then logging out/in again.

Either option should provide the same functionality/stability. Refer to the
Sway wiki page for information.
EOD
}

post_upgrade() {
cat << EOD
Sway's necessary privileges can now be obtained through seatd as well as the
incumbent polkit package. As such, polkit has been relegated to an optional
dependency.

Note that using seatd instead of polkit means that a user must be a part of the
"seat" group: Otherwise, the user will not be able to achieve the appropriate
privileged actions.

For more information, refer to the Sway wiki page.
EOD
}

0 comments on commit 7990b32

Please sign in to comment.