-
Notifications
You must be signed in to change notification settings - Fork 10
64 lines (57 loc) · 2.31 KB
/
publish.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
64
name: Publish Rhino Linux Images
on: workflow_dispatch
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/[email protected]
with:
path: os
- name: Change APT repository URLs because of the Ubuntu Archive slowdowns
run: |
sudo sed -i 's/azure\.archive\.ubuntu\.com/mirrors.mit.edu/g' /etc/apt/sources.list
sudo sed -i 's/jammy/.\/devel/g' /etc/apt/sources.list
- name: Update APT cache
run: sudo apt-get update
- name: Install rclone
run: sudo apt-get install rclone -y
- name: Set up rclone config
run: |
mkdir -p /home/runner/.config/rclone
rclone config create sourceforge sftp host frs.sourceforge.net user ${{ secrets.SOURCEFORGE_USER }} shell_type unix use_insecure_cipher true pass ${{ secrets.SOURCEFORGE_PASS }} --obscure
- name: Download release assets from latest CI run
run: gh run download -p '*' "$(gh run list -w devel.yml --json databaseId -q '.[].databaseId' -L 1)"
env:
GH_TOKEN: "${{ github.token }}"
GH_REPO: "${{ github.repository }}"
- name: Upload assets to SourceForge
run: |
source os/etc/terraform.conf
HEADVER="${VERSION}${SUBVER}"
PHONE="${HEADVER}-pinephone"
TAB="${HEADVER}-pinetab"
RPI="${HEADVER}-rpi"
for image in *.iso *.img.xz; do
case "${image}" in
*iso)
TRUEVER="$HEADVER"
;;
*phone*)
TRUEVER="$PHONE"
;;
*tab*)
TRUEVER="$TAB"
;;
*rpi*)
TRUEVER="$RPI"
;;
esac
if ! [[ -d "${TRUEVER}/" ]]; then
mkdir "${TRUEVER}/"
fi
mv "${image}"/"${image}" "${TRUEVER}/"
sha256sum "${TRUEVER}/${image}" >> "${TRUEVER}/${image}".sha256
rclone copyto --progress --sftp-ask-password "${TRUEVER}/${image}.sha256" "sourceforge:/home/frs/project/rhino-linux-builder/${TRUEVER}/${image}.sha256"
rclone copyto --progress --sftp-ask-password "${TRUEVER}/${image}" "sourceforge:/home/frs/project/rhino-linux-builder/${TRUEVER}/${image}";
done