Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
oklopfer authored Jul 12, 2023
1 parent e0f6216 commit d5446fa
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/publish-pinephone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Publish RL PinePhone 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 pinephone.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 *.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

0 comments on commit d5446fa

Please sign in to comment.