-
Notifications
You must be signed in to change notification settings - Fork 20
63 lines (57 loc) · 2.39 KB
/
cleanup-test-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: 'cleanup-test-release'
on:
workflow_dispatch:
inputs:
pr_number:
description: 'pr to delete assets for'
required: true
pull_request:
types: [closed]
env:
version: ci-test-ignore-me-${{ github.event.inputs.pr_number || github.event.number }}
edition: xfce
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
jobs:
clean:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- name: delete test-release for closed pr
if: always()
run: |
echo ${{ github.token }} | gh auth login --with-token
gh release delete ${{ env.version }} -y --repo ${{ github.repository }}
git push --delete origin ${{ env.version }}
- name: ssh-prepare
if: always()
run: |
mkdir -p /home/runner/.ssh
touch /home/runner/.ssh/github_actions
chmod 600 /home/runner/.ssh/github_actions
ssh-agent -a /tmp/ssh_agent.sock > /dev/null
- name: delete cdn77 test upload
if: always()
run: |
ssh-keyscan -t rsa ${{ secrets.CDN_HOST }} >> /home/runner/.ssh/known_hosts
sshpass -p "${{ secrets.CDN_PWD }}" rsync --delete -vaP --stats \
-e ssh $(mktemp) ${{ secrets.CDN_USER }}@${{ secrets.CDN_HOST }}:/www/${{ env.edition }}/${{ env.version }}
- name: delete sourceforge test upload
if: always()
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
ssh-keyscan -t rsa frs.sourceforge.net >> /home/runner/.ssh/known_hosts
echo "${{ secrets.SF_PRIV_SSHKEY }}" >> /home/runner/.ssh/github_actions
ssh-add /home/runner/.ssh/github_actions
rsync --delete -vaP --stats \
-e ssh $(mktemp) ${{ secrets.SF_USER_NAME }}@frs.sourceforge.net:/home/frs/project/manjarolinux/${{ env.edition }}/${{ env.version }}
- name: delete osdn test upload
if: always()
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
ssh-keyscan -t rsa storage.osdn.net >> /home/runner/.ssh/known_hosts
echo "${{ secrets.OSDN_PRIV_SSHKEY }}" >> /home/runner/.ssh/github_actions
ssh-add /home/runner/.ssh/github_actions
rsync --delete -vaP --stats \
-e ssh $(mktemp) ${{ secrets.OSDN_USER_NAME }}@storage.osdn.net:/storage/groups/m/ma/manjaro/${{ env.edition }}/${{ env.version }}