From 1adbf2c0f691f3ef56c23f2dea097c1b39a1ad62 Mon Sep 17 00:00:00 2001 From: Dmitry Porunov Date: Fri, 1 Nov 2019 03:10:05 +0400 Subject: [PATCH 01/12] Fix source url --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7551199..184c202 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,7 +27,7 @@ package-aur: # Determine remote URLs and SHA checksums - echo "Determining SHA checksums for remote files..." - - URL_SOURCE=https://git.auteiy.me/dmitry/cursorsPosy/-/archive/v$VERSION/ffsend-v$VERSION.tar.gz + - URL_SOURCE=https://git.auteiy.me/dmitry/cursorsPosy/-/archive/v$VERSION/cursorsPosy-v$VERSION.tar.gz - 'echo "Selected source URL: $URL_SOURCE"' - echo "Determining sha256sum for remote source..." - 'SHA_SOURCE=$(curl -sSL "$URL_SOURCE" | sha256sum | cut -d" " -f1)' @@ -36,7 +36,7 @@ package-aur: # Update PKGBUILD parameters: version, source URL and SHA sum - echo "Updating PKGBUILDS with release information..." - sed "s/^pkgver=.*\$/pkgver=$VERSION/" -i posy-cursors/PKGBUILD - - sed "s/^source=(\"\(.*\)::.*\").*\$/source=(\"\1::$(echo $URL_SOURCE | sed 's/\//\\\//g')\")/" -i ffsend/PKGBUILD + - sed "s/^source=(\"\(.*\)::.*\").*\$/source=(\"\1::$(echo $URL_SOURCE | sed 's/\//\\\//g')\")/" -i posy-cursors/PKGBUILD - sed "s/^sha256sums=.*\$/sha256sums=('$SHA_SOURCE')/" -i posy-cursors/PKGBUILD # Get SHA hash for local and remote file w/o version, update if it has changed From c16ac69f0fde4c27f26b6f4cfca480b2aa1487e2 Mon Sep 17 00:00:00 2001 From: Dmitry Porunov Date: Fri, 1 Nov 2019 03:11:06 +0400 Subject: [PATCH 02/12] What's this? --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 184c202..0834a36 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,8 +15,8 @@ package-aur: # needs: # - release-github dependencies: [] - only: - - /^v(\d+\.)*\d+$/ + # only: + # - /^v(\d+\.)*\d+$/ before_script: [] script: - cd ./pkg/aur From 94e06bb116349f190f9d6fb1a2f0947fc2dfde50 Mon Sep 17 00:00:00 2001 From: Dmitry Porunov Date: Fri, 1 Nov 2019 03:12:48 +0400 Subject: [PATCH 03/12] Fix .gitlab-ci.yml --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0834a36..184c202 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,8 +15,8 @@ package-aur: # needs: # - release-github dependencies: [] - # only: - # - /^v(\d+\.)*\d+$/ + only: + - /^v(\d+\.)*\d+$/ before_script: [] script: - cd ./pkg/aur From 0aa4b0eba3f6da17314420a1d6750118f74827ec Mon Sep 17 00:00:00 2001 From: Dmitry Porunov Date: Fri, 1 Nov 2019 03:25:34 +0400 Subject: [PATCH 04/12] Fix .gitlab-ci.yml URL_SOURCE --- .gitlab-ci.yml | 2 +- pkg/aur/posy-cursors/PKGBUILD_REF | 42 ------------------------------- 2 files changed, 1 insertion(+), 43 deletions(-) delete mode 100644 pkg/aur/posy-cursors/PKGBUILD_REF diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 184c202..9896e3f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,7 +27,7 @@ package-aur: # Determine remote URLs and SHA checksums - echo "Determining SHA checksums for remote files..." - - URL_SOURCE=https://git.auteiy.me/dmitry/cursorsPosy/-/archive/v$VERSION/cursorsPosy-v$VERSION.tar.gz + - URL_SOURCE=https://git.auteiy.me/dmitry/cursorsPosy/-/archive/v$VERSION/cursorsPosy-v$VERSION.tar.gz?path=themes - 'echo "Selected source URL: $URL_SOURCE"' - echo "Determining sha256sum for remote source..." - 'SHA_SOURCE=$(curl -sSL "$URL_SOURCE" | sha256sum | cut -d" " -f1)' diff --git a/pkg/aur/posy-cursors/PKGBUILD_REF b/pkg/aur/posy-cursors/PKGBUILD_REF deleted file mode 100644 index 82482ca..0000000 --- a/pkg/aur/posy-cursors/PKGBUILD_REF +++ /dev/null @@ -1,42 +0,0 @@ -# Maintainer: Tim Visee -# -# This PKGBUILD is managed externally, and is automatically updated here: -# - https://gitlab.com/timvisee/ffsend/blob/master/pkg/aur/ffsend/PKGBUILD -# - Mirror: https://github.com/timvisee/ffsend/blob/master/pkg/aur/ffsend/PKGBUILD - -pkgname=ffsend -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-v$pkgver.tar.gz::$url/-/archive/v$pkgver/ffsend-v$pkgver.tar.gz") # automatically set in CI, see: /.gitlab-ci.yml -sha256sums=('SKIP') # automatically set in CI, see: /.gitlab-ci.yml -arch=('x86_64' 'i686') -provides=('ffsend') -depends=('ca-certificates') -makedepends=('openssl>=1.0' 'rust>=1.32' 'cargo' 'cmake') -optdepends=('xclip: clipboard support' - 'bash-completion: support auto completion for bash') - -build() { - cd "ffsend-v$pkgver" - env CARGO_INCREMENTAL=0 cargo build --release -} - -package() { - cd "$srcdir/ffsend-v$pkgver" - - # Install Binary - install -Dm755 "./target/release/ffsend" "$pkgdir/usr/bin/ffsend" - - # Install shell completions and LICENSE file - install -Dm644 "contrib/completions/ffsend.bash" \ - "$pkgdir/etc/bash_completion.d/ffsend" - install -Dm644 "contrib/completions/_ffsend" \ - "$pkgdir/usr/share/zsh/site-functions/_ffsend" - install -Dm644 "contrib/completions/ffsend.fish" \ - "$pkgdir/usr/share/fish/vendor_completions.d/ffsend.fish" - install -Dm644 "LICENSE" \ - "$pkgdir/usr/share/licenses/ffsend/LICENSE" -} From 3d3125f4fe6e8ce1d35e7470c5305ef9b4ea8481 Mon Sep 17 00:00:00 2001 From: Dmitry Porunov Date: Fri, 1 Nov 2019 03:33:44 +0400 Subject: [PATCH 05/12] Fix .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9896e3f..a0e8dce 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -64,7 +64,7 @@ package-aur: # else # echo "Not making git source package, it has not changed" # fi - # - cd .. + - cd .. # Set up SSH for publishing - mkdir -p /root/.ssh From 2a391702fda0e200cd12fd97fe946feae365951a Mon Sep 17 00:00:00 2001 From: Dmitry Porunov Date: Fri, 1 Nov 2019 03:42:02 +0400 Subject: [PATCH 06/12] Use echo instead of cat for variable --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a0e8dce..c72daa5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -69,7 +69,7 @@ package-aur: # Set up SSH for publishing - mkdir -p /root/.ssh - cp ./aur.pub /root/.ssh/id_rsa.pub - - cat "$AUR_SSH_PRIVATE" | base64 -d > /root/.ssh/id_rsa + - echo "$AUR_SSH_PRIVATE" | base64 -d > /root/.ssh/id_rsa - echo "Host aur.archlinux.org" >> /root/.ssh/config - echo " IdentityFile /root/.ssh/aur" >> /root/.ssh/config - echo " User aur" >> /root/.ssh/config From 1f7ce8b6fb0e8425ca65efa69dea40bc8eacbe08 Mon Sep 17 00:00:00 2001 From: Dmitry Porunov Date: Fri, 1 Nov 2019 03:51:37 +0400 Subject: [PATCH 07/12] Add debug echo --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c72daa5..8607b16 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -68,6 +68,8 @@ package-aur: # Set up SSH for publishing - mkdir -p /root/.ssh + - echo "$AUR_SSH_PRIVATE" + - sleep 5 - cp ./aur.pub /root/.ssh/id_rsa.pub - echo "$AUR_SSH_PRIVATE" | base64 -d > /root/.ssh/id_rsa - echo "Host aur.archlinux.org" >> /root/.ssh/config From 06046d478d87fa36dba2cadb2033eaba2b501299 Mon Sep 17 00:00:00 2001 From: Dmitry Porunov Date: Fri, 1 Nov 2019 03:56:00 +0400 Subject: [PATCH 08/12] Debugging --- .gitlab-ci.yml | 113 +--------------------------------------------- .gitlab-ci.yml_ | 118 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 120 insertions(+), 111 deletions(-) create mode 100644 .gitlab-ci.yml_ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8607b16..82cf879 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,114 +5,5 @@ # - export a build artifact from the new job # - manually upload artifact to GitHub in the 'github-release' job -stages: - - package - -# AUR packages release -package-aur: - image: archlinux/base - stage: package - # needs: - # - release-github - dependencies: [] - only: - - /^v(\d+\.)*\d+$/ - before_script: [] - script: - - cd ./pkg/aur - - # Determine the version number we're releasing for - - VERSION=$(echo $CI_COMMIT_REF_NAME | cut -c 2-) - - echo "Determined binary version number 'v$VERSION'" - - # Determine remote URLs and SHA checksums - - echo "Determining SHA checksums for remote files..." - - URL_SOURCE=https://git.auteiy.me/dmitry/cursorsPosy/-/archive/v$VERSION/cursorsPosy-v$VERSION.tar.gz?path=themes - - 'echo "Selected source URL: $URL_SOURCE"' - - echo "Determining sha256sum for remote source..." - - 'SHA_SOURCE=$(curl -sSL "$URL_SOURCE" | sha256sum | cut -d" " -f1)' - - 'echo "Got sha256sum: $SHA_SOURCE"' - - # Update PKGBUILD parameters: version, source URL and SHA sum - - echo "Updating PKGBUILDS with release information..." - - sed "s/^pkgver=.*\$/pkgver=$VERSION/" -i posy-cursors/PKGBUILD - - sed "s/^source=(\"\(.*\)::.*\").*\$/source=(\"\1::$(echo $URL_SOURCE | sed 's/\//\\\//g')\")/" -i posy-cursors/PKGBUILD - - sed "s/^sha256sums=.*\$/sha256sums=('$SHA_SOURCE')/" -i posy-cursors/PKGBUILD - - # Get SHA hash for local and remote file w/o version, update if it has changed - # - 'SHA_STRIP_LOCAL=$(cat ffsend-git/PKGBUILD | sed /^pkgver=.\*/d | sha256sum | cut -d" " -f1)' - # - 'SHA_STRIP_REMOTE=$(curl -sSL "https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=ffsend-git" | sed /^pkgver=.\*/d | sha256sum | cut -d" " -f1)' - - # Install dependencies - - echo "Installing required build packages..." - - pacman -Syu --noconfirm sudo base-devel openssh git openssl - - # Make AUR package - - mkdir -p /.cargo - - chmod -R 777 /.cargo - - cd posy-cursors/ - - echo "Making main source package..." - - sudo -u nobody makepkg -c - - sudo -u nobody makepkg --printsrcinfo > .SRCINFO - # Make git package if different than the remote - # - | - # if [ ! "$SHA_STRIP_LOCAL" == "$SHA_STRIP_REMOTE" ]; then - # cd ../ffsend-git - # echo "Making git source package..." - # sudo -u nobody makepkg -c - # sudo -u nobody makepkg --printsrcinfo > .SRCINFO - # else - # echo "Not making git source package, it has not changed" - # fi - - cd .. - - # Set up SSH for publishing - - mkdir -p /root/.ssh - - echo "$AUR_SSH_PRIVATE" - - sleep 5 - - cp ./aur.pub /root/.ssh/id_rsa.pub - - echo "$AUR_SSH_PRIVATE" | base64 -d > /root/.ssh/id_rsa - - echo "Host aur.archlinux.org" >> /root/.ssh/config - - echo " IdentityFile /root/.ssh/aur" >> /root/.ssh/config - - echo " User aur" >> /root/.ssh/config - - chmod 600 /root/.ssh/{id_rsa*,config} - - eval `ssh-agent -s` - - ssh-add /root/.ssh/id_rsa - - ssh-keyscan -H aur.archlinux.org >> /root/.ssh/known_hosts - - git config --global user.name "Dmitry Porunov" - - git config --global user.email "dmitry@auteiy.me" - - # Publish main package: clone AUR repo, commit update and push - - git clone ssh://aur@aur.archlinux.org/posy-cursors.git aur-posy-cursors - - cd aur-posy-cursors - - cp ../posy-cursors/{PKGBUILD,.SRCINFO} ./ - - git add PKGBUILD .SRCINFO - - git commit -m "Release v$VERSION" - - git push - - cd .. - - # Publish binary package: clone AUR repo, commit update and push - # - git clone ssh://aur@aur.archlinux.org/ffsend-bin.git aur-ffsend-bin - # - cd aur-ffsend-bin - # - cp ../ffsend-bin/{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 - # Only publish it if it is different than the remote - # - | - # if [ ! "$SHA_STRIP_LOCAL" == "$SHA_STRIP_REMOTE" ]; then - # git clone ssh://aur@aur.archlinux.org/ffsend-git.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 .. - # else - # echo "Not pushing git package, it has not changed" - # fi - -# TODO: add job to test ffsend{-git} AUR packages +script: + - echo "$TEST" diff --git a/.gitlab-ci.yml_ b/.gitlab-ci.yml_ new file mode 100644 index 0000000..8607b16 --- /dev/null +++ b/.gitlab-ci.yml_ @@ -0,0 +1,118 @@ +# GitLab CI configuration for ffsend builds, tests and releases +# +# To add a new release: +# - configure a new 'build-*' job with the proper target +# - export a build artifact from the new job +# - manually upload artifact to GitHub in the 'github-release' job + +stages: + - package + +# AUR packages release +package-aur: + image: archlinux/base + stage: package + # needs: + # - release-github + dependencies: [] + only: + - /^v(\d+\.)*\d+$/ + before_script: [] + script: + - cd ./pkg/aur + + # Determine the version number we're releasing for + - VERSION=$(echo $CI_COMMIT_REF_NAME | cut -c 2-) + - echo "Determined binary version number 'v$VERSION'" + + # Determine remote URLs and SHA checksums + - echo "Determining SHA checksums for remote files..." + - URL_SOURCE=https://git.auteiy.me/dmitry/cursorsPosy/-/archive/v$VERSION/cursorsPosy-v$VERSION.tar.gz?path=themes + - 'echo "Selected source URL: $URL_SOURCE"' + - echo "Determining sha256sum for remote source..." + - 'SHA_SOURCE=$(curl -sSL "$URL_SOURCE" | sha256sum | cut -d" " -f1)' + - 'echo "Got sha256sum: $SHA_SOURCE"' + + # Update PKGBUILD parameters: version, source URL and SHA sum + - echo "Updating PKGBUILDS with release information..." + - sed "s/^pkgver=.*\$/pkgver=$VERSION/" -i posy-cursors/PKGBUILD + - sed "s/^source=(\"\(.*\)::.*\").*\$/source=(\"\1::$(echo $URL_SOURCE | sed 's/\//\\\//g')\")/" -i posy-cursors/PKGBUILD + - sed "s/^sha256sums=.*\$/sha256sums=('$SHA_SOURCE')/" -i posy-cursors/PKGBUILD + + # Get SHA hash for local and remote file w/o version, update if it has changed + # - 'SHA_STRIP_LOCAL=$(cat ffsend-git/PKGBUILD | sed /^pkgver=.\*/d | sha256sum | cut -d" " -f1)' + # - 'SHA_STRIP_REMOTE=$(curl -sSL "https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=ffsend-git" | sed /^pkgver=.\*/d | sha256sum | cut -d" " -f1)' + + # Install dependencies + - echo "Installing required build packages..." + - pacman -Syu --noconfirm sudo base-devel openssh git openssl + + # Make AUR package + - mkdir -p /.cargo + - chmod -R 777 /.cargo + - cd posy-cursors/ + - echo "Making main source package..." + - sudo -u nobody makepkg -c + - sudo -u nobody makepkg --printsrcinfo > .SRCINFO + # Make git package if different than the remote + # - | + # if [ ! "$SHA_STRIP_LOCAL" == "$SHA_STRIP_REMOTE" ]; then + # cd ../ffsend-git + # echo "Making git source package..." + # sudo -u nobody makepkg -c + # sudo -u nobody makepkg --printsrcinfo > .SRCINFO + # else + # echo "Not making git source package, it has not changed" + # fi + - cd .. + + # Set up SSH for publishing + - mkdir -p /root/.ssh + - echo "$AUR_SSH_PRIVATE" + - sleep 5 + - cp ./aur.pub /root/.ssh/id_rsa.pub + - echo "$AUR_SSH_PRIVATE" | base64 -d > /root/.ssh/id_rsa + - echo "Host aur.archlinux.org" >> /root/.ssh/config + - echo " IdentityFile /root/.ssh/aur" >> /root/.ssh/config + - echo " User aur" >> /root/.ssh/config + - chmod 600 /root/.ssh/{id_rsa*,config} + - eval `ssh-agent -s` + - ssh-add /root/.ssh/id_rsa + - ssh-keyscan -H aur.archlinux.org >> /root/.ssh/known_hosts + - git config --global user.name "Dmitry Porunov" + - git config --global user.email "dmitry@auteiy.me" + + # Publish main package: clone AUR repo, commit update and push + - git clone ssh://aur@aur.archlinux.org/posy-cursors.git aur-posy-cursors + - cd aur-posy-cursors + - cp ../posy-cursors/{PKGBUILD,.SRCINFO} ./ + - git add PKGBUILD .SRCINFO + - git commit -m "Release v$VERSION" + - git push + - cd .. + + # Publish binary package: clone AUR repo, commit update and push + # - git clone ssh://aur@aur.archlinux.org/ffsend-bin.git aur-ffsend-bin + # - cd aur-ffsend-bin + # - cp ../ffsend-bin/{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 + # Only publish it if it is different than the remote + # - | + # if [ ! "$SHA_STRIP_LOCAL" == "$SHA_STRIP_REMOTE" ]; then + # git clone ssh://aur@aur.archlinux.org/ffsend-git.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 .. + # else + # echo "Not pushing git package, it has not changed" + # fi + +# TODO: add job to test ffsend{-git} AUR packages From f7dd5cf6d3ce14b0cbba4329c314b2a94d96a50d Mon Sep 17 00:00:00 2001 From: Dmitry Porunov Date: Fri, 1 Nov 2019 03:59:24 +0400 Subject: [PATCH 09/12] Debugging --- .gitlab-ci.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 82cf879..3060e43 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,5 +5,17 @@ # - export a build artifact from the new job # - manually upload artifact to GitHub in the 'github-release' job -script: +stages: + - package + +# AUR packages release +package-aur: + image: archlinux/base + stage: package + # needs: + # - release-github + dependencies: [] + before_script: [] + script: + - echo "$AUR_SSH_PRIVATE" - echo "$TEST" From faf6a27366ca8efe1b83e2fd78a47b7a4ded7e9e Mon Sep 17 00:00:00 2001 From: Dmitry Porunov Date: Fri, 1 Nov 2019 04:04:19 +0400 Subject: [PATCH 10/12] Another try --- .gitlab-ci.yml | 99 +++++++++++++++++++++++++++++++++++++++- .gitlab-ci.yml_ | 118 ------------------------------------------------ 2 files changed, 98 insertions(+), 119 deletions(-) delete mode 100644 .gitlab-ci.yml_ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3060e43..8607b16 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,7 +15,104 @@ package-aur: # needs: # - release-github dependencies: [] + only: + - /^v(\d+\.)*\d+$/ before_script: [] script: + - cd ./pkg/aur + + # Determine the version number we're releasing for + - VERSION=$(echo $CI_COMMIT_REF_NAME | cut -c 2-) + - echo "Determined binary version number 'v$VERSION'" + + # Determine remote URLs and SHA checksums + - echo "Determining SHA checksums for remote files..." + - URL_SOURCE=https://git.auteiy.me/dmitry/cursorsPosy/-/archive/v$VERSION/cursorsPosy-v$VERSION.tar.gz?path=themes + - 'echo "Selected source URL: $URL_SOURCE"' + - echo "Determining sha256sum for remote source..." + - 'SHA_SOURCE=$(curl -sSL "$URL_SOURCE" | sha256sum | cut -d" " -f1)' + - 'echo "Got sha256sum: $SHA_SOURCE"' + + # Update PKGBUILD parameters: version, source URL and SHA sum + - echo "Updating PKGBUILDS with release information..." + - sed "s/^pkgver=.*\$/pkgver=$VERSION/" -i posy-cursors/PKGBUILD + - sed "s/^source=(\"\(.*\)::.*\").*\$/source=(\"\1::$(echo $URL_SOURCE | sed 's/\//\\\//g')\")/" -i posy-cursors/PKGBUILD + - sed "s/^sha256sums=.*\$/sha256sums=('$SHA_SOURCE')/" -i posy-cursors/PKGBUILD + + # Get SHA hash for local and remote file w/o version, update if it has changed + # - 'SHA_STRIP_LOCAL=$(cat ffsend-git/PKGBUILD | sed /^pkgver=.\*/d | sha256sum | cut -d" " -f1)' + # - 'SHA_STRIP_REMOTE=$(curl -sSL "https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=ffsend-git" | sed /^pkgver=.\*/d | sha256sum | cut -d" " -f1)' + + # Install dependencies + - echo "Installing required build packages..." + - pacman -Syu --noconfirm sudo base-devel openssh git openssl + + # Make AUR package + - mkdir -p /.cargo + - chmod -R 777 /.cargo + - cd posy-cursors/ + - echo "Making main source package..." + - sudo -u nobody makepkg -c + - sudo -u nobody makepkg --printsrcinfo > .SRCINFO + # Make git package if different than the remote + # - | + # if [ ! "$SHA_STRIP_LOCAL" == "$SHA_STRIP_REMOTE" ]; then + # cd ../ffsend-git + # echo "Making git source package..." + # sudo -u nobody makepkg -c + # sudo -u nobody makepkg --printsrcinfo > .SRCINFO + # else + # echo "Not making git source package, it has not changed" + # fi + - cd .. + + # Set up SSH for publishing + - mkdir -p /root/.ssh - echo "$AUR_SSH_PRIVATE" - - echo "$TEST" + - sleep 5 + - cp ./aur.pub /root/.ssh/id_rsa.pub + - echo "$AUR_SSH_PRIVATE" | base64 -d > /root/.ssh/id_rsa + - echo "Host aur.archlinux.org" >> /root/.ssh/config + - echo " IdentityFile /root/.ssh/aur" >> /root/.ssh/config + - echo " User aur" >> /root/.ssh/config + - chmod 600 /root/.ssh/{id_rsa*,config} + - eval `ssh-agent -s` + - ssh-add /root/.ssh/id_rsa + - ssh-keyscan -H aur.archlinux.org >> /root/.ssh/known_hosts + - git config --global user.name "Dmitry Porunov" + - git config --global user.email "dmitry@auteiy.me" + + # Publish main package: clone AUR repo, commit update and push + - git clone ssh://aur@aur.archlinux.org/posy-cursors.git aur-posy-cursors + - cd aur-posy-cursors + - cp ../posy-cursors/{PKGBUILD,.SRCINFO} ./ + - git add PKGBUILD .SRCINFO + - git commit -m "Release v$VERSION" + - git push + - cd .. + + # Publish binary package: clone AUR repo, commit update and push + # - git clone ssh://aur@aur.archlinux.org/ffsend-bin.git aur-ffsend-bin + # - cd aur-ffsend-bin + # - cp ../ffsend-bin/{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 + # Only publish it if it is different than the remote + # - | + # if [ ! "$SHA_STRIP_LOCAL" == "$SHA_STRIP_REMOTE" ]; then + # git clone ssh://aur@aur.archlinux.org/ffsend-git.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 .. + # else + # echo "Not pushing git package, it has not changed" + # fi + +# TODO: add job to test ffsend{-git} AUR packages diff --git a/.gitlab-ci.yml_ b/.gitlab-ci.yml_ deleted file mode 100644 index 8607b16..0000000 --- a/.gitlab-ci.yml_ +++ /dev/null @@ -1,118 +0,0 @@ -# GitLab CI configuration for ffsend builds, tests and releases -# -# To add a new release: -# - configure a new 'build-*' job with the proper target -# - export a build artifact from the new job -# - manually upload artifact to GitHub in the 'github-release' job - -stages: - - package - -# AUR packages release -package-aur: - image: archlinux/base - stage: package - # needs: - # - release-github - dependencies: [] - only: - - /^v(\d+\.)*\d+$/ - before_script: [] - script: - - cd ./pkg/aur - - # Determine the version number we're releasing for - - VERSION=$(echo $CI_COMMIT_REF_NAME | cut -c 2-) - - echo "Determined binary version number 'v$VERSION'" - - # Determine remote URLs and SHA checksums - - echo "Determining SHA checksums for remote files..." - - URL_SOURCE=https://git.auteiy.me/dmitry/cursorsPosy/-/archive/v$VERSION/cursorsPosy-v$VERSION.tar.gz?path=themes - - 'echo "Selected source URL: $URL_SOURCE"' - - echo "Determining sha256sum for remote source..." - - 'SHA_SOURCE=$(curl -sSL "$URL_SOURCE" | sha256sum | cut -d" " -f1)' - - 'echo "Got sha256sum: $SHA_SOURCE"' - - # Update PKGBUILD parameters: version, source URL and SHA sum - - echo "Updating PKGBUILDS with release information..." - - sed "s/^pkgver=.*\$/pkgver=$VERSION/" -i posy-cursors/PKGBUILD - - sed "s/^source=(\"\(.*\)::.*\").*\$/source=(\"\1::$(echo $URL_SOURCE | sed 's/\//\\\//g')\")/" -i posy-cursors/PKGBUILD - - sed "s/^sha256sums=.*\$/sha256sums=('$SHA_SOURCE')/" -i posy-cursors/PKGBUILD - - # Get SHA hash for local and remote file w/o version, update if it has changed - # - 'SHA_STRIP_LOCAL=$(cat ffsend-git/PKGBUILD | sed /^pkgver=.\*/d | sha256sum | cut -d" " -f1)' - # - 'SHA_STRIP_REMOTE=$(curl -sSL "https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=ffsend-git" | sed /^pkgver=.\*/d | sha256sum | cut -d" " -f1)' - - # Install dependencies - - echo "Installing required build packages..." - - pacman -Syu --noconfirm sudo base-devel openssh git openssl - - # Make AUR package - - mkdir -p /.cargo - - chmod -R 777 /.cargo - - cd posy-cursors/ - - echo "Making main source package..." - - sudo -u nobody makepkg -c - - sudo -u nobody makepkg --printsrcinfo > .SRCINFO - # Make git package if different than the remote - # - | - # if [ ! "$SHA_STRIP_LOCAL" == "$SHA_STRIP_REMOTE" ]; then - # cd ../ffsend-git - # echo "Making git source package..." - # sudo -u nobody makepkg -c - # sudo -u nobody makepkg --printsrcinfo > .SRCINFO - # else - # echo "Not making git source package, it has not changed" - # fi - - cd .. - - # Set up SSH for publishing - - mkdir -p /root/.ssh - - echo "$AUR_SSH_PRIVATE" - - sleep 5 - - cp ./aur.pub /root/.ssh/id_rsa.pub - - echo "$AUR_SSH_PRIVATE" | base64 -d > /root/.ssh/id_rsa - - echo "Host aur.archlinux.org" >> /root/.ssh/config - - echo " IdentityFile /root/.ssh/aur" >> /root/.ssh/config - - echo " User aur" >> /root/.ssh/config - - chmod 600 /root/.ssh/{id_rsa*,config} - - eval `ssh-agent -s` - - ssh-add /root/.ssh/id_rsa - - ssh-keyscan -H aur.archlinux.org >> /root/.ssh/known_hosts - - git config --global user.name "Dmitry Porunov" - - git config --global user.email "dmitry@auteiy.me" - - # Publish main package: clone AUR repo, commit update and push - - git clone ssh://aur@aur.archlinux.org/posy-cursors.git aur-posy-cursors - - cd aur-posy-cursors - - cp ../posy-cursors/{PKGBUILD,.SRCINFO} ./ - - git add PKGBUILD .SRCINFO - - git commit -m "Release v$VERSION" - - git push - - cd .. - - # Publish binary package: clone AUR repo, commit update and push - # - git clone ssh://aur@aur.archlinux.org/ffsend-bin.git aur-ffsend-bin - # - cd aur-ffsend-bin - # - cp ../ffsend-bin/{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 - # Only publish it if it is different than the remote - # - | - # if [ ! "$SHA_STRIP_LOCAL" == "$SHA_STRIP_REMOTE" ]; then - # git clone ssh://aur@aur.archlinux.org/ffsend-git.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 .. - # else - # echo "Not pushing git package, it has not changed" - # fi - -# TODO: add job to test ffsend{-git} AUR packages From 4ad5ddec00c32b29d3a138eb81a3724b47d75451 Mon Sep 17 00:00:00 2001 From: Dmitry Porunov Date: Fri, 1 Nov 2019 04:15:35 +0400 Subject: [PATCH 11/12] Make script enter passphrase --- .gitlab-ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8607b16..af94f21 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -68,8 +68,6 @@ package-aur: # Set up SSH for publishing - mkdir -p /root/.ssh - - echo "$AUR_SSH_PRIVATE" - - sleep 5 - cp ./aur.pub /root/.ssh/id_rsa.pub - echo "$AUR_SSH_PRIVATE" | base64 -d > /root/.ssh/id_rsa - echo "Host aur.archlinux.org" >> /root/.ssh/config @@ -77,7 +75,8 @@ package-aur: - echo " User aur" >> /root/.ssh/config - chmod 600 /root/.ssh/{id_rsa*,config} - eval `ssh-agent -s` - - ssh-add /root/.ssh/id_rsa + # - ssh-add /root/.ssh/id_rsa + - echo -en "${PASSPHRASE}" | ssh-add /root/.ssh/id_rsa - ssh-keyscan -H aur.archlinux.org >> /root/.ssh/known_hosts - git config --global user.name "Dmitry Porunov" - git config --global user.email "dmitry@auteiy.me" From cbd402db9b7004778c8b24264ddbba4b97edb24f Mon Sep 17 00:00:00 2001 From: Dmitry Porunov Date: Fri, 1 Nov 2019 04:27:37 +0400 Subject: [PATCH 12/12] Autoupdate and push PKGBUILD to AUR with each new release --- .gitlab-ci.yml | 86 ++++++++------------------------------------------ 1 file changed, 14 insertions(+), 72 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index af94f21..e26bc20 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,19 +1,9 @@ -# GitLab CI configuration for ffsend builds, tests and releases -# -# To add a new release: -# - configure a new 'build-*' job with the proper target -# - export a build artifact from the new job -# - manually upload artifact to GitHub in the 'github-release' job - stages: - package -# AUR packages release package-aur: image: archlinux/base stage: package - # needs: - # - release-github dependencies: [] only: - /^v(\d+\.)*\d+$/ @@ -21,62 +11,40 @@ package-aur: script: - cd ./pkg/aur - # Determine the version number we're releasing for - - VERSION=$(echo $CI_COMMIT_REF_NAME | cut -c 2-) - - echo "Determined binary version number 'v$VERSION'" + - _version=$(echo $CI_COMMIT_REF_NAME | cut -c 2-) + - echo "Pushing'v$_version'" - # Determine remote URLs and SHA checksums - - echo "Determining SHA checksums for remote files..." - - URL_SOURCE=https://git.auteiy.me/dmitry/cursorsPosy/-/archive/v$VERSION/cursorsPosy-v$VERSION.tar.gz?path=themes - - 'echo "Selected source URL: $URL_SOURCE"' - - echo "Determining sha256sum for remote source..." - - 'SHA_SOURCE=$(curl -sSL "$URL_SOURCE" | sha256sum | cut -d" " -f1)' - - 'echo "Got sha256sum: $SHA_SOURCE"' + - sourceURL=https://git.auteiy.me/dmitry/cursorsPosy/-/archive/v$_version/cursorsPosy-v$_version.tar.gz?path=themes + - 'echo "Source: $sourceURL"' + - echo "Checking sha256sum checksums" + - 'sourceSHA=$(curl -sSL "$sourceURL" | sha256sum | cut -d" " -f1)' # Update PKGBUILD parameters: version, source URL and SHA sum - echo "Updating PKGBUILDS with release information..." - - sed "s/^pkgver=.*\$/pkgver=$VERSION/" -i posy-cursors/PKGBUILD - - sed "s/^source=(\"\(.*\)::.*\").*\$/source=(\"\1::$(echo $URL_SOURCE | sed 's/\//\\\//g')\")/" -i posy-cursors/PKGBUILD - - sed "s/^sha256sums=.*\$/sha256sums=('$SHA_SOURCE')/" -i posy-cursors/PKGBUILD - - # Get SHA hash for local and remote file w/o version, update if it has changed - # - 'SHA_STRIP_LOCAL=$(cat ffsend-git/PKGBUILD | sed /^pkgver=.\*/d | sha256sum | cut -d" " -f1)' - # - 'SHA_STRIP_REMOTE=$(curl -sSL "https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=ffsend-git" | sed /^pkgver=.\*/d | sha256sum | cut -d" " -f1)' + - sed "s/^pkgver=.*\$/pkgver=$_version/" -i posy-cursors/PKGBUILD + - sed "s/^source=(\"\(.*\)::.*\").*\$/source=(\"\1::$(echo $sourceURL | sed 's/\//\\\//g')\")/" -i posy-cursors/PKGBUILD + - sed "s/^sha256sums=.*\$/sha256sums=('$sourceSHA')/" -i posy-cursors/PKGBUILD - # Install dependencies - - echo "Installing required build packages..." + - echo "Installing Arch" - pacman -Syu --noconfirm sudo base-devel openssh git openssl # Make AUR package - - mkdir -p /.cargo - - chmod -R 777 /.cargo - cd posy-cursors/ - - echo "Making main source package..." + - echo "makepkg" - sudo -u nobody makepkg -c - sudo -u nobody makepkg --printsrcinfo > .SRCINFO - # Make git package if different than the remote - # - | - # if [ ! "$SHA_STRIP_LOCAL" == "$SHA_STRIP_REMOTE" ]; then - # cd ../ffsend-git - # echo "Making git source package..." - # sudo -u nobody makepkg -c - # sudo -u nobody makepkg --printsrcinfo > .SRCINFO - # else - # echo "Not making git source package, it has not changed" - # fi - cd .. # Set up SSH for publishing - mkdir -p /root/.ssh - cp ./aur.pub /root/.ssh/id_rsa.pub - - echo "$AUR_SSH_PRIVATE" | base64 -d > /root/.ssh/id_rsa + - echo "$sshAUR" | base64 -d > /root/.ssh/id_rsa - echo "Host aur.archlinux.org" >> /root/.ssh/config - echo " IdentityFile /root/.ssh/aur" >> /root/.ssh/config - echo " User aur" >> /root/.ssh/config - chmod 600 /root/.ssh/{id_rsa*,config} - eval `ssh-agent -s` - # - ssh-add /root/.ssh/id_rsa - - echo -en "${PASSPHRASE}" | ssh-add /root/.ssh/id_rsa + - echo -en "${sshPASSPHRASE}" | ssh-add /root/.ssh/id_rsa - ssh-keyscan -H aur.archlinux.org >> /root/.ssh/known_hosts - git config --global user.name "Dmitry Porunov" - git config --global user.email "dmitry@auteiy.me" @@ -86,32 +54,6 @@ package-aur: - cd aur-posy-cursors - cp ../posy-cursors/{PKGBUILD,.SRCINFO} ./ - git add PKGBUILD .SRCINFO - - git commit -m "Release v$VERSION" + - git commit -m "Release v$_version" - git push - cd .. - - # Publish binary package: clone AUR repo, commit update and push - # - git clone ssh://aur@aur.archlinux.org/ffsend-bin.git aur-ffsend-bin - # - cd aur-ffsend-bin - # - cp ../ffsend-bin/{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 - # Only publish it if it is different than the remote - # - | - # if [ ! "$SHA_STRIP_LOCAL" == "$SHA_STRIP_REMOTE" ]; then - # git clone ssh://aur@aur.archlinux.org/ffsend-git.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 .. - # else - # echo "Not pushing git package, it has not changed" - # fi - -# TODO: add job to test ffsend{-git} AUR packages