瀏覽代碼

Define ffsend-git AUR package as well, release it through CI

timvisee 6 年之前
父節點
當前提交
e6118122d5
共有 2 個文件被更改,包括 44 次插入14 次删除
  1. 15 14
      .gitlab-ci.yml
  2. 29 0
      pkg/aur/ffsend-git/PKGBUILD

+ 15 - 14
.gitlab-ci.yml

@@ -284,6 +284,7 @@ package-aur:
     - echo "Updating PKGBUILDS with release information..."
     - sed "s/^pkgver=.*\$/pkgver=$VERSION/" -i ffsend/PKGBUILD
     - sed "s/^pkgver=.*\$/pkgver=$VERSION/" -i ffsend-bin/PKGBUILD
+    - sed "s/^pkgver=.*\$/pkgver=$VERSION.$CI_COMMIT_SHORT_SHA/" -i ffsend-git/PKGBUILD
     - sed "s/^source=(\"\(.*\)::.*\").*\$/source=('\1::$(echo $URL_SOURCE | sed 's/\//\\\//g')')/" -i ffsend/PKGBUILD
     - sed "s/^source=(\"\(.*\)::.*\").*\$/source=('\1::$(echo $URL_BIN | sed 's/\//\\\//g')')/" -i ffsend-bin/PKGBUILD
     - sed "s/^sha256sums=.*\$/sha256sums=('$SHA_SOURCE')/" -i ffsend/PKGBUILD
@@ -304,11 +305,11 @@ package-aur:
     - echo "Making main source package..."
     - sudo -u nobody makepkg -c
     - sudo -u nobody makepkg --printsrcinfo > .SRCINFO
-    # # TODO: only do this if the file has changed!
-    # - cd ../ffsend-git
-    # - echo "Making git source package..."
-    # - sudo -u nobody makepkg -c
-    # - sudo -u nobody makepkg --printsrcinfo > .SRCINFO
+    # TODO: only do this if the file has changed?
+    - cd ../ffsend-git
+    - echo "Making git source package..."
+    - sudo -u nobody makepkg -c
+    - sudo -u nobody makepkg --printsrcinfo > .SRCINFO
     - cd ..
 
     # Set up SSH for publishing
@@ -343,14 +344,14 @@ package-aur:
     - git push
     - cd ..
 
-    # # Publish git package: clone AUR repo, commit update and push
-    # # TODO: only push here if things have changed!
-    # - git clone ssh://aur@aur.archlinux.org/ffsend.git aur-ffsend-git
-    # - cd aur-ffsend-git
-    # - cp ../ffsend-git/{PKGBUILD,.SRCINFO} ./
-    # - git add PKGBUILD .SRCINFO
-    # - git commit -m "Release v$VERSION"
-    # - git push
-    # - cd ..
+    # Publish git package: clone AUR repo, commit update and push
+    # TODO: only push here if things have changed!
+    - git clone ssh://aur@aur.archlinux.org/ffsend.git aur-ffsend-git
+    - cd aur-ffsend-git
+    - cp ../ffsend-git/{PKGBUILD,.SRCINFO} ./
+    - git add PKGBUILD .SRCINFO
+    - git commit -m "Update PKGBUILD for release v$VERSION"
+    - git push
+    - cd ..
 
 # TODO: add job to test ffsend{-git} AUR packages

+ 29 - 0
pkg/aur/ffsend-git/PKGBUILD

@@ -0,0 +1,29 @@
+# Maintainer: Tim Visee <tim@visee.me>
+#
+# This PKGBUILD is managed externally, and is automatically updated here:
+# - https://gitlab.com/timvisee/ffsend/blob/master/pkg/aur/ffsend-git/PKGBUILD
+# - Mirror: https://github.com/timvisee/ffsend/blob/master/pkg/aur/ffsend-git/PKGBUILD
+
+pkgname=ffsend-git
+pkgver=0.0.0 # automatically set in CI, see: /.gitlab-ci.yml
+pkgrel=1
+pkgdesc="Easily and securely share files from the command line. A Firefox Send client."
+url="https://gitlab.com/timvisee/ffsend"
+license=('GPL3')
+source=("ffsend::git+$url.git")
+sha256sums=('SKIP')
+arch=('x86_64' 'i686')
+provides=('ffsend')
+conflicts=('ffsend')
+depends=('ca-certificates')
+makedepends=('openssl>=1.0' 'rust>=1.32' 'cargo' 'cmake')
+optdepends=('xclip: clipboard support')
+
+build() {
+    cd ffsend
+    env CARGO_INCREMENTAL=0 cargo build --release
+}
+
+package() {
+    install -Dm755 "$srcdir/ffsend/target/release/ffsend" "$pkgdir/usr/bin/ffsend"
+}