Switch from b2 to rclone for file uploads across all CI jobs #4
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: CI | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
build_macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: "recursive" | |
- name: Set up Rust | |
run: | | |
curl https://sh.rustup.rs -sSf | sh -s -- -y | |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
- name: Build GUI | |
run: | | |
cd gephgui-wry/gephgui | |
npm i -f | |
npm run build | |
- name: Build macOS | |
run: | | |
cd macos | |
./build-macos.bash | |
- name: Install rclone | |
run: | | |
brew install rclone | |
- name: Configure rclone | |
run: | | |
mkdir -p ~/.config/rclone | |
echo "[b2]" > ~/.config/rclone/rclone.conf | |
echo "type = b2" >> ~/.config/rclone/rclone.conf | |
echo "account = ${{ secrets.B2_KEYID }}" >> ~/.config/rclone/rclone.conf | |
echo "key = ${{ secrets.B2_APPKEY }}" >> ~/.config/rclone/rclone.conf | |
- name: Upload to B2 | |
run: rclone copy macos/geph-macos.zip b2:geph-dl/STAGING/geph-macos.zip | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: geph-macos | |
path: macos/geph-macos.zip | |
build_flatpak: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: "recursive" | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt install flatpak-builder flatpak ca-certificates | |
- name: Set up Flatpak | |
run: | | |
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo | |
- name: Build Flatpak | |
run: | | |
flatpak-builder --force-clean --install-deps-from flathub --user build-dir flatpak/io.geph.GephGui.yml --repo=repo | |
flatpak build-bundle repo io.geph.GephGui.flatpak io.geph.GephGui --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo | |
- name: Install rclone | |
run: | | |
sudo -v ; curl https://rclone.org/install.sh | sudo bash | |
- name: Configure rclone | |
run: | | |
mkdir -p ~/.config/rclone | |
echo "[b2]" > ~/.config/rclone/rclone.conf | |
echo "type = b2" >> ~/.config/rclone/rclone.conf | |
echo "account = ${{ secrets.B2_KEYID }}" >> ~/.config/rclone/rclone.conf | |
echo "key = ${{ secrets.B2_APPKEY }}" >> ~/.config/rclone/rclone.conf | |
- name: Upload to B2 | |
run: rclone copy io.geph.GephGui.flatpak b2:geph-dl/STAGING/Geph-x86_64.flatpak | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: geph-flatpak | |
path: io.geph.GephGui.flatpak | |
build_windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: "recursive" | |
- name: Set up Rust | |
run: | | |
curl https://win.rustup.rs/ -o rustup-init.exe | |
./rustup-init -y --default-toolchain "stable-i686-pc-windows-msvc" --profile minimal | |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
- name: Build GUI | |
run: | | |
cd gephgui-wry/gephgui | |
npm i -f | |
npm run build | |
- name: Build Windows | |
run: | | |
$env:PATH += ";C:\Users\runneradmin\.cargo\bin" | |
$env:CARGO_NET_GIT_FETCH_WITH_CLI = "true" | |
bash windows/build-windows.bash | |
- name: Install rclone | |
run: | | |
Invoke-WebRequest https://downloads.rclone.org/rclone-current-windows-amd64.zip -OutFile rclone.zip | |
Expand-Archive rclone.zip -DestinationPath . | |
Move-Item rclone-*-windows-amd64/rclone.exe . | |
- name: Configure rclone | |
run: | | |
New-Item -ItemType Directory -Force -Path $env:USERPROFILE\.config\rclone | |
@" | |
[b2] | |
type = b2 | |
account = ${{ secrets.B2_KEYID }} | |
key = ${{ secrets.B2_APPKEY }} | |
"@ | Out-File -FilePath $env:USERPROFILE\.config\rclone\rclone.conf -Encoding ASCII | |
- name: Upload to B2 | |
run: .\rclone.exe copy windows/Output/geph-windows-setup.exe b2:geph-dl/STAGING/geph-windows-setup.exe | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: geph-windows | |
path: windows/Output/geph-windows-setup.exe |