Skip to content

Upload Zips

Upload Zips #6

# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path
name: Upload Zips
on:
workflow_dispatch:
inputs:
supabase:
description: 'Upload to supabase?'
type: boolean
default: true
required: false
cloudinary:
description: 'Upload to cloudinary?'
type: boolean
default: true
required: false
bitbucket:
description: 'Upload to bitbucket?'
type: boolean
default: true
required: false
giteePush:
description: 'Push to gitee?'
type: boolean
default: true
required: false
bitbucketPush:
description: 'Push to bitbucket?'
type: boolean
default: true
required: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.ref }}
- name: Set up JDK 1.8
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
- name: Read tag_latest and Save build info
id: tag_latest
run: |
python ./.github/scripts/read_version_and_save_build_info.py
- name: Download files
run: |
wget https://github.com/nICEnnnnnnnLee/BilibiliDown/releases/download/V${{steps.tag_latest.outputs.value}}/BilibiliDown.v${{steps.tag_latest.outputs.value}}.release.zip
wget https://github.com/nICEnnnnnnnLee/BilibiliDown/releases/download/V${{steps.tag_latest.outputs.value}}/BilibiliDown.v${{steps.tag_latest.outputs.value}}.release.zip.sha1
- name: Upload release to supabase
env:
VERSION_NUMBER: ${{ steps.tag_latest.outputs.value }}
SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }}
if: ${{ always() && env.SUPABASE_ANON_KEY != '' && github.event.inputs.supabase == 'true'}}
run: |
chmod +x .github/scripts/upload_supabase.sh
./.github/scripts/upload_supabase.sh
- name: Upload release to cloudinary
env:
CLOUDINARY_API_KEY: ${{ secrets.CLOUDINARY_API_KEY }}
CLOUDINARY_API_SECRET: ${{ secrets.CLOUDINARY_API_SECRET }}
ZIP_FILE_NAME: BilibiliDown.v${{steps.tag_latest.outputs.value}}.release.zip
SHA1_FILE_NAME: BilibiliDown.v${{steps.tag_latest.outputs.value}}.release.zip.sha1
if: ${{ always() && env.CLOUDINARY_API_KEY != '' && env.CLOUDINARY_API_SECRET != '' && github.event.inputs.cloudinary == 'true'}}
run: |
chmod +x .github/scripts/upload_cloudinary.sh
./.github/scripts/upload_cloudinary.sh
- name: Upload release to bitbucket
env:
VERSION_NUMBER: ${{ steps.tag_latest.outputs.value }}
BITBUCKET_TOKEN: ${{ secrets.BITBUCKET_TOKEN }}
if: ${{ always() && env.BITBUCKET_TOKEN != '' && github.event.inputs.bitbucket == 'true'}}
run: |
chmod +x .github/scripts/upload_bitbucket.sh
./.github/scripts/upload_bitbucket.sh
- name: Sync Push to Gitee
env:
GITEE_AUTH: ${{ secrets.GITEE_AUTH }}
if: ${{ always() && env.GITEE_AUTH != '' && github.event.inputs.giteePush == 'true'}}
run: |
chmod +x .github/scripts/sync_push_to_gitee.sh
./.github/scripts/sync_push_to_gitee.sh
- name: Sync Push to Bitbucket
env:
BITBUCKET_TOKEN: ${{ secrets.BITBUCKET_TOKEN }}
if: ${{ always() && env.BITBUCKET_TOKEN != '' && github.event.inputs.bitbucketPush == 'true'}}
run: |
chmod +x .github/scripts/sync_push_to_bitbucket.sh
./.github/scripts/sync_push_to_bitbucket.sh