[pull] master from troyeguo:master #2
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: Download and Upload Release Files | ||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Download release files | ||
run: | | ||
curl -s https://api.github.com/repos/koodo-reader/koodo-reader/releases/latest | \ | ||
jq -r ".assets[] | .browser_download_url" | \ | ||
xargs -L 1 curl -LO | ||
- name: Install B2 CLI | ||
run: | | ||
curl https://f000.backblazeb2.com/file/backblazeb2-public/b2-linux-x86_64 -o b2 | ||
chmod +x b2 | ||
- name: Create or update folder in Backblaze | ||
run: | | ||
./b2 authorize-account ${{ secrets.B2_ACCOUNT_ID }} ${{ secrets.B2_APPLICATION_KEY }} | ||
./b2 create-bucket ${{ secrets.B2_BUCKET_NAME }} ${{ github.ref }} allPublic | ||
- name: Upload release files to Backblaze | ||
run: | | ||
./b2 authorize-account ${{ secrets.B2_ACCOUNT_ID }} ${{ secrets.B2_APPLICATION_KEY }} | ||
./b2 sync --delete --excludeRegex ".*\.git.*" release_files/ ${{ secrets.B2_BUCKET_NAME }}/${{ github.ref }} |