Skip to content

Commit 7990b32

Browse files
authored
Add PKGBUILD stable and -git, AUR publish and Arch build GitHub Actions (#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
1 parent c82adeb commit 7990b32

File tree

10 files changed

+324
-2
lines changed

10 files changed

+324
-2
lines changed

.github/workflows/AUR_publish.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Package for the AUR
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
# Allows you to run this workflow manually from the Actions tab
8+
workflow_dispatch:
9+
jobs:
10+
aur-publish:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check out sources
14+
uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
# Checks out the latest tag
18+
- run: |
19+
git stash save "Action stashing changes"
20+
latestTag=$(git describe --abbrev=0 --tags)
21+
git checkout $latestTag
22+
23+
- name: Publish AUR Stable package
24+
uses: ulises-jeremias/github-actions-aur-publish@v1
25+
with:
26+
pkgname: swayfx
27+
pkgbuild: ./build-scripts/aur/PKGBUILD
28+
assets: |
29+
./build-scripts/aur/50-systemd-user.conf
30+
./build-scripts/aur/sway.install
31+
commit_username: ${{ secrets.AUR_USERNAME }}
32+
commit_email: ${{ secrets.AUR_EMAIL }}
33+
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
34+
commit_message: Update AUR package
35+
ssh_keyscan_types: rsa,dsa,ecdsa,ed25519
36+
update_pkgver: false
37+
38+
# Checks out the the Master branch
39+
- run: |
40+
git checkout master
41+
- name: Publish AUR -git package
42+
uses: ulises-jeremias/github-actions-aur-publish@v1
43+
with:
44+
pkgname: swayfx-git
45+
pkgbuild: ./build-scripts/aur-git/PKGBUILD
46+
assets: |
47+
./build-scripts/aur-git/50-systemd-user.conf
48+
./build-scripts/aur-git/sway.install
49+
commit_username: ${{ secrets.AUR_USERNAME }}
50+
commit_email: ${{ secrets.AUR_EMAIL }}
51+
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
52+
commit_message: Update AUR package
53+
ssh_keyscan_types: rsa,dsa,ecdsa,ed25519
54+
update_pkgver: false

.github/workflows/arch-build.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Check build for Arch.
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
jobs:
13+
arch-build:
14+
container: archlinux:latest
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
# It is necessary to checkout into sub-directory, because of some weird ownership problems cause by using containers
19+
- name: Check out sources
20+
uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 0
23+
path: swayfx
24+
25+
- name: Git makepkg build and check
26+
id: makepkg
27+
uses: edlanglois/pkgbuild-action@v1
28+
with:
29+
pkgdir: ./swayfx/build-scripts/aur-git
30+
31+
- name: Stable makepkg build and check
32+
id: makepkg
33+
uses: edlanglois/pkgbuild-action@v1
34+
with:
35+
pkgdir: ./swayfx/build-scripts/aur

.github/workflows/fedora-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
workflow_dispatch:
1111

1212
jobs:
13-
package:
13+
fedora-build:
1414
container: fedora:37
1515
runs-on: ubuntu-latest
1616

.github/workflows/fedora-copr.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
workflow_dispatch:
99

1010
jobs:
11-
package:
11+
fedora-copr:
1212
container: fedora:latest
1313
runs-on: ubuntu-latest
1414

@@ -31,6 +31,12 @@ jobs:
3131
with:
3232
fetch-depth: 0
3333
path: swayfx
34+
# Checks out the latest tag
35+
- run: |
36+
cd swayfx
37+
git stash save "Action stashing changes"
38+
latestTag=$(git describe --abbrev=0 --tags)
39+
git checkout $latestTag
3440
3541
- name: Copy spec into root dir
3642
run: |
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# sway does not set DISPLAY/WAYLAND_DISPLAY in the systemd user environment
2+
# See FS#63021
3+
# Adapted from xorg's 50-systemd-user.sh, which achieves a similar goal.
4+
5+
exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP
6+
exec hash dbus-update-activation-environment 2>/dev/null && \
7+
dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP

build-scripts/aur-git/PKGBUILD

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Maintainer: Erik Reider <erik.reider@protonmail.com>
2+
_pkgname=swayfx
3+
pkgname="$_pkgname-git"
4+
pkgver=r6905.e2ef3ceb
5+
pkgrel=1
6+
license=("MIT")
7+
pkgdesc="SwayFX: Sway, but with eye candy!"
8+
makedepends=(
9+
"git"
10+
"meson"
11+
"scdoc"
12+
"wayland-protocols"
13+
)
14+
depends=(
15+
"cairo"
16+
"gdk-pixbuf2"
17+
"libevdev.so"
18+
"libinput"
19+
"libjson-c.so"
20+
"libudev.so"
21+
"libwayland-server.so"
22+
"libwlroots.so"
23+
"libxcb"
24+
"libxkbcommon.so"
25+
"pango"
26+
"pcre"
27+
"ttf-font"
28+
"wlroots<0.16"
29+
)
30+
optdepends=(
31+
"alacritty: Terminal emulator used by the default config"
32+
"dmenu: Application launcher"
33+
"grim: Screenshot utility"
34+
"i3status: Status line"
35+
"mako: Lightweight notification daemon"
36+
"slurp: Select a region"
37+
"swayidle: Idle management daemon"
38+
"swaylock: Screen locker"
39+
"wallutils: Timed wallpapers"
40+
"waybar: Highly customizable bar"
41+
)
42+
backup=(etc/sway/config)
43+
arch=("i686" "x86_64")
44+
url="https://github.com/WillPower3309/swayfx"
45+
source=("${pkgname%-*}::git+${url}.git"
46+
50-systemd-user.conf)
47+
sha512sums=(
48+
"SKIP"
49+
"c2b7d808f4231f318e03789015624fd4cf32b81434b15406570b4e144c0defc54e216d881447e6fd9fc18d7da608cccb61c32e0e1fab2f1fe2750acf812d3137")
50+
provides=("sway" "swayfx")
51+
conflicts=("sway" "swayfx")
52+
options=(debug)
53+
install=sway.install
54+
55+
pkgver() {
56+
cd "$_pkgname"
57+
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
58+
}
59+
60+
build() {
61+
arch-meson \
62+
-Dsd-bus-provider=libsystemd \
63+
-Dwerror=false \
64+
"$_pkgname" build
65+
meson compile -C build
66+
}
67+
68+
package() {
69+
install -Dm644 50-systemd-user.conf -t "$pkgdir/etc/sway/config.d/"
70+
71+
DESTDIR="$pkgdir" meson install -C build
72+
73+
cd "$_pkgname"
74+
install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
75+
for util in autoname-workspaces.py inactive-windows-transparency.py grimshot; do
76+
install -Dm755 "contrib/$util" -t "$pkgdir/usr/share/$pkgname/scripts"
77+
done
78+
}

build-scripts/aur-git/sway.install

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
post_install() {
2+
cat << EOD
3+
Sway requires additional setup for privilege escalation. Without this setup,
4+
sway will fail to start with session activation permission failures. Choose one
5+
of the two available options (In alphabetical, not recommended, order):
6+
7+
1. polkit: This will make sway "just work" right after installation but may be
8+
a weightier solution than desired.
9+
10+
2. seatd: Already required as a sway dependency, this is a lighter-weight
11+
solution but requires some user configuration: Enabling the service,
12+
adding your user to the "seat" group, then logging out/in again.
13+
14+
Either option should provide the same functionality/stability. Refer to the
15+
Sway wiki page for information.
16+
EOD
17+
}
18+
19+
post_upgrade() {
20+
cat << EOD
21+
Sway's necessary privileges can now be obtained through seatd as well as the
22+
incumbent polkit package. As such, polkit has been relegated to an optional
23+
dependency.
24+
25+
Note that using seatd instead of polkit means that a user must be a part of the
26+
"seat" group: Otherwise, the user will not be able to achieve the appropriate
27+
privileged actions.
28+
29+
For more information, refer to the Sway wiki page.
30+
EOD
31+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# sway does not set DISPLAY/WAYLAND_DISPLAY in the systemd user environment
2+
# See FS#63021
3+
# Adapted from xorg's 50-systemd-user.sh, which achieves a similar goal.
4+
5+
exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP
6+
exec hash dbus-update-activation-environment 2>/dev/null && \
7+
dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP

build-scripts/aur/PKGBUILD

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Maintainer: Erik Reider <erik.reider@protonmail.com>
2+
_pkgname=swayfx
3+
pkgname="$_pkgname"
4+
pkgver=0.1
5+
pkgrel=1
6+
license=("MIT")
7+
pkgdesc="SwayFX: Sway, but with eye candy!"
8+
makedepends=(
9+
"git"
10+
"meson"
11+
"scdoc"
12+
"wayland-protocols"
13+
)
14+
depends=(
15+
"cairo"
16+
"gdk-pixbuf2"
17+
"libevdev.so"
18+
"libinput"
19+
"libjson-c.so"
20+
"libudev.so"
21+
"libwayland-server.so"
22+
"libwlroots.so"
23+
"libxcb"
24+
"libxkbcommon.so"
25+
"pango"
26+
"pcre"
27+
"ttf-font"
28+
"wlroots<0.16"
29+
)
30+
optdepends=(
31+
"alacritty: Terminal emulator used by the default config"
32+
"dmenu: Application launcher"
33+
"grim: Screenshot utility"
34+
"i3status: Status line"
35+
"mako: Lightweight notification daemon"
36+
"slurp: Select a region"
37+
"swayidle: Idle management daemon"
38+
"swaylock: Screen locker"
39+
"wallutils: Timed wallpapers"
40+
"waybar: Highly customizable bar"
41+
)
42+
backup=(etc/sway/config)
43+
arch=("i686" "x86_64")
44+
url="https://github.com/WillPower3309/swayfx"
45+
source=("${url}/releases/download/$pkgver/swayfx-$pkgver.tar.gz"
46+
50-systemd-user.conf)
47+
sha512sums=(
48+
"SKIP"
49+
"c2b7d808f4231f318e03789015624fd4cf32b81434b15406570b4e144c0defc54e216d881447e6fd9fc18d7da608cccb61c32e0e1fab2f1fe2750acf812d3137")
50+
provides=("sway" "swayfx")
51+
conflicts=("sway" "swayfx")
52+
options=(debug)
53+
install=sway.install
54+
55+
build() {
56+
arch-meson \
57+
-Dsd-bus-provider=libsystemd \
58+
-Dwerror=false \
59+
"$_pkgname" build
60+
meson compile -C build
61+
}
62+
63+
package() {
64+
install -Dm644 50-systemd-user.conf -t "$pkgdir/etc/sway/config.d/"
65+
66+
DESTDIR="$pkgdir" meson install -C build
67+
68+
cd "$_pkgname"
69+
install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
70+
for util in autoname-workspaces.py inactive-windows-transparency.py grimshot; do
71+
install -Dm755 "contrib/$util" -t "$pkgdir/usr/share/$pkgname/scripts"
72+
done
73+
}

build-scripts/aur/sway.install

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
post_install() {
2+
cat << EOD
3+
Sway requires additional setup for privilege escalation. Without this setup,
4+
sway will fail to start with session activation permission failures. Choose one
5+
of the two available options (In alphabetical, not recommended, order):
6+
7+
1. polkit: This will make sway "just work" right after installation but may be
8+
a weightier solution than desired.
9+
10+
2. seatd: Already required as a sway dependency, this is a lighter-weight
11+
solution but requires some user configuration: Enabling the service,
12+
adding your user to the "seat" group, then logging out/in again.
13+
14+
Either option should provide the same functionality/stability. Refer to the
15+
Sway wiki page for information.
16+
EOD
17+
}
18+
19+
post_upgrade() {
20+
cat << EOD
21+
Sway's necessary privileges can now be obtained through seatd as well as the
22+
incumbent polkit package. As such, polkit has been relegated to an optional
23+
dependency.
24+
25+
Note that using seatd instead of polkit means that a user must be a part of the
26+
"seat" group: Otherwise, the user will not be able to achieve the appropriate
27+
privileged actions.
28+
29+
For more information, refer to the Sway wiki page.
30+
EOD
31+
}

0 commit comments

Comments
 (0)