Skip to content

Commit a820ad7

Browse files
committed
ci(llvm-releases): ssh uses relative user paths
The previously hard-coded paths only work on ubuntu. On windows and macOS, these paths don't exist, don't have the necessary permissions, or are ignored by ssh.
1 parent 390159e commit a820ad7

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

.github/workflows/ci.yml

+21-10
Original file line numberDiff line numberDiff line change
@@ -806,20 +806,31 @@ jobs:
806806
- name: Website LLVM Releases
807807
if: steps.llvm-cache.outputs.cache-hit == 'true' && github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name) || startsWith(github.ref, 'refs/tags/'))
808808
working-directory: ../third-party/llvm-project
809-
env:
810-
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
811809
run: |
810+
set -x
811+
812+
# Ensure required commands exist
813+
for cmd in ssh-keyscan ssh-agent ssh-add scp; do
814+
if ! command -v $cmd >/dev/null; then
815+
echo "$cmd not found"
816+
exit 1
817+
fi
818+
done
819+
812820
# Add SSH key
813-
mkdir -p /home/runner/.ssh
814-
ssh-keyscan dev-websites.cpp.al >> /home/runner/.ssh/known_hosts
815-
chmod 600 /home/runner/.ssh/known_hosts
816-
echo "${{ secrets.DEV_WEBSITES_SSH_KEY }}" > /home/runner/.ssh/github_actions
817-
chmod 600 /home/runner/.ssh/github_actions
821+
mkdir -p ~/.ssh
822+
ssh-keyscan dev-websites.cpp.al >> ~/.ssh/known_hosts
823+
chmod 600 ~/.ssh/known_hosts
824+
echo "${{ secrets.DEV_WEBSITES_SSH_KEY }}" > ~/.ssh/github_actions
825+
chmod 600 ~/.ssh/github_actions
826+
827+
# Start ssh-agent and add the key
828+
SSH_AUTH_SOCK="$RUNNER_TEMP/ssh_agent.sock"
818829
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
819-
ssh-add /home/runner/.ssh/github_actions
830+
ssh-add ~/.ssh/github_actions
820831
821-
# Remove previous demos associated with this tag
832+
# Copy llvm archive: This step will copy the archive to www.mrdocs.com/llvm+clang
822833
llvm_dir="/var/www/mrdox.com/llvm+clang"
823-
chmod 755 -R ${{ matrix.llvm-archive-filename }}
834+
chmod 755 ${{ matrix.llvm-archive-filename }}
824835
scp -o StrictHostKeyChecking=no $(pwd)/${{ matrix.llvm-archive-filename }} [email protected]:$llvm_dir/
825836

0 commit comments

Comments
 (0)