Commit 909c7069ce

909c7069ce6dd3d713038408c4d9b565c69ad7e2

parent: 6c7fc3e3d3

Unsigned

Wraient <wraient.911@gmail.com> · 2025-08-26 22:28 UTC

ci/cd: install deps

Layout: unified · split

.github/workflows/update-aur.yml +15 −24
@@ -32,6 +32,11 @@ jobs:
3232 echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
3333 echo "Extracted version: $VERSION"
3434
35 - name: Install dependencies
36 run: |
37 sudo apt-get update
38 sudo apt-get install -y expect git sshpass
39
3540 - name: Set up SSH for AUR
3641 run: |
3742 mkdir -p ~/.ssh
@@ -49,6 +54,10 @@ jobs:
4954
5055 # Start SSH agent and add key with passphrase
5156 eval $(ssh-agent -s)
57 echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV
58 echo "SSH_AGENT_PID=$SSH_AGENT_PID" >> $GITHUB_ENV
59
60 # Use expect to add the key with passphrase
5261 expect -c "
5362 spawn ssh-add ~/.ssh/aur_rsa
5463 expect \"Enter passphrase\"
@@ -56,20 +65,9 @@ jobs:
5665 expect eof
5766 "
5867
59 - name: Install dependencies
60 run: |
61 sudo apt-get update
62 sudo apt-get install -y expect git
63
6468 - name: Clone AUR repository
6569 run: |
66 eval $(ssh-agent -s)
67 expect -c "
68 spawn ssh-add ~/.ssh/aur_rsa
69 expect \"Enter passphrase\"
70 send \"sex\r\"
71 expect eof
72 "
70 # The SSH agent should still be running with the key loaded
7371 git clone ssh://aur@aur.archlinux.org/curd.git aur-curd
7472
7573 - name: Update PKGBUILD
@@ -103,15 +101,6 @@ jobs:
103101 - name: Commit and push to AUR
104102 working-directory: aur-curd
105103 run: |
106 # Start SSH agent for the commit/push
107 eval $(ssh-agent -s)
108 expect -c "
109 spawn ssh-add ~/.ssh/aur_rsa
110 expect \"Enter passphrase\"
111 send \"sex\r\"
112 expect eof
113 " 2>/dev/null
114
115104 # Check if there are changes to commit
116105 if git diff --quiet && git diff --cached --quiet; then
117106 echo "No changes to commit"
@@ -122,12 +111,14 @@ jobs:
122111 git add PKGBUILD .SRCINFO
123112 git commit -m "Update to version ${{ steps.version.outputs.version }}"
124113
125 # Push changes
114 # Push changes (SSH agent should still have the key loaded)
126115 git push origin master
127116
128117 - name: Cleanup
129118 if: always()
130119 run: |
131 # Clean up SSH keys
120 # Clean up SSH keys and kill SSH agent
132121 rm -f ~/.ssh/aur_rsa
133 ssh-agent -k 2>/dev/null || true
122 if [ -n "$SSH_AGENT_PID" ]; then
123 kill $SSH_AGENT_PID 2>/dev/null || true
124 fi