-
Notifications
You must be signed in to change notification settings - Fork 12
54 lines (48 loc) · 2.03 KB
/
pp-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
name: Publish RL PinePhone Images
on: workflow_dispatch
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3.5.0
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