From 9a0a13fea0e839fb26ac3058b504a3b872621011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Sch=C3=A4ferdiek?= Date: Thu, 17 Aug 2023 22:31:23 +0000 Subject: [PATCH] =?UTF-8?q?feature/move-to-forgejo=20(#1)=20Co-authored-by?= =?UTF-8?q?:=20Alexander=20Sch=C3=A4ferdiek=20?= =?UTF-8?q?=20Co-committed-by:=20Alexander=20Sch=C3=A4ferdiek=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 47 ----------------------------------- .forgejo/workflows/build.yaml | 44 ++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 47 deletions(-) delete mode 100644 .drone.yml create mode 100644 .forgejo/workflows/build.yaml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 6252798..0000000 --- a/.drone.yml +++ /dev/null @@ -1,47 +0,0 @@ ---- -kind: pipeline -type: docker -name: build - -trigger: - event: - include: - - push - - pull_request - -steps: - - name: test - image: koalaman/shellcheck-alpine:latest - commands: - - find usr/local/bin -type f -exec echo Testing {} \; -exec shellcheck {} \; - - name: build arch package - image: archlinux/archlinux:base-devel - commands: - - useradd -m build - - pacman -Syu --noconfirm - - pacman -Sy --noconfirm git - - cp -r /drone/src/_pkg/ /home/build/ - - chown -R build:build /home/build - - cd /home/build/_pkg - - sudo -u build makepkg -csf - - sudo -u build repo-add repo-aur-myservermanager-com.db.tar.gz *.zst - - cp *.zst /drone/src/_pkg/ - - cp *.tar.gz /drone/src/_pkg/ - - name: upload to aur.myservermanager.com - image: drillster/drone-rsync - environment: - PLUGIN_ARGS: -zz - settings: - hosts: - - myservermanager.com - port: 2222 - user: myservermanager-com - key: - from_secret: deploy_ssh_key - source: ./_pkg/{*.zst,*.db.tar.gz,*.files.tar.gz} - target: /srv/http/myservermanager.com/htdocs/aur/ - delete: true - recursive: false - when: - branch: - - master diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml new file mode 100644 index 0000000..899e1ac --- /dev/null +++ b/.forgejo/workflows/build.yaml @@ -0,0 +1,44 @@ +on: [ push ] +jobs: + build: + runs-on: docker + container: + image: archlinux/archlinux:base-devel + steps: + - name: Prepare requirements + run: | + pacman -Syu --noconfirm + pacman -Sy --noconfirm nodejs npm git + pacman -Sy --noconfirm shellcheck openssh rsync + pacman -Scc --noconfirm + + - uses: actions/checkout@v3 + name: Clone + + - name: Shellcheck + run: | + find usr/local/bin -type f -exec echo Testing {} \; -exec shellcheck {} \; + + - name: Build ArchLinux package + run: | + useradd -m build + cp -r ${{ github.workspace }}/_pkg/ /home/build/ + chown -R build:build /home/build + cd /home/build/_pkg + sudo -u build makepkg -csf + sudo -u build repo-add repo-aur-myservermanager-com.db.tar.gz *.zst + cp *.zst ${{ github.workspace }}/_pkg/ + cp *.tar.gz ${{ github.workspace }}/_pkg/ + echo "Produced package and AUR contents" + ls -la ${{ github.workspace }}/_pkg/ + + - name: Synchronize to custom ArchLinux User Repository + env: + KEY: ${{ secrets.DEPLOY_SSH_KEY }} + USER: ${{ secrets.DEPLOY_SSH_USER }} + HOST: ${{ secrets.DEPLOY_SSH_HOST }} + run: | + mkdir -p ~/.ssh + echo -n $KEY | base64 -di >> ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + rsync -az -zz -r --del -e 'ssh -p 2222 -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o StrictHostKeyChecking=no' ${{ github.workspace }}/_pkg/{*.zst,*.db.tar.gz,*.files.tar.gz} $USER@$HOST:/srv/http/myservermanager.com/htdocs/aur/