Publish Rhino Linux Images #37
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 | |
- 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: | | |
# Normally we'd be able to run something like | |
# 'rclone config create ...', but that isn't working for some reason. | |
# So we'll make the config manually instead. | |
# | |
# See https://github.com/rhino-linux/os/actions/runs/5396018584/jobs/9799166656 | |
# as an example. | |
mkdir ~/.config/rclone | |
echo " | |
[wasabi] | |
type = s3 | |
provider = Wasabi | |
access_key_id = ${{ secrets.WASABI_ACCESS_KEY_ID }} | |
secret_access_key = ${{ secrets.WASABI_ACCESS_KEY_SECRET }} | |
endpoint = s3.wasabisys.com | |
" > ~/.config/rclone/rclone.conf | |
- 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 Wasabi | |
run: | | |
source os/etc/terraform.conf | |
mkdir builds/ | |
for iso in *.iso *.img.xz; do | |
mv "${iso}"/"${iso}" builds/ | |
sha256sum "builds/${iso}" >> "builds/${iso}".sha256 | |
rclone copyto --progress --s3-no-check-bucket "builds/${iso}.sha256" "wasabi:dl.rhinolinux.org/releases/${VERSION}${SUBVER}/${iso}.sha256" | |
rclone copyto --progress --s3-no-check-bucket "builds/${iso}" "wasabi:dl.rhinolinux.org/releases/${VERSION}${SUBVER}/${iso}"; | |
done |