Publish Rhino Linux Images #61
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 legacy.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 |