Merge pull request #162 from nICEnnnnnnnLee/dev #41
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
# 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: Build Release | |
on: | |
workflow_dispatch: | |
inputs: {} | |
push: | |
branches: | |
- master | |
paths: | |
# Trigger only when src/** changes | |
- ".github/release.info" | |
# push: | |
# paths: | |
# # Trigger only when src/** changes | |
# - ".github/release.json" | |
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: Package Jar | |
run: | | |
chmod +x package.sh | |
./package.sh | |
chmod +x .github/scripts/package_launcher.sh | |
./.github/scripts/package_launcher.sh | |
- name: Test Jar | |
env: | |
VERSION_NUMBER: ${{ steps.tag_latest.outputs.value }} | |
run: | | |
chmod +x .github/scripts/test_jar.sh | |
./.github/scripts/test_jar.sh | |
- name: ZIP files | |
env: | |
VERSION_NUMBER: ${{ steps.tag_latest.outputs.value }} | |
run: | | |
chmod +x .github/scripts/gen_zip_sha1_for_release.sh | |
./.github/scripts/gen_zip_sha1_for_release.sh | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: V${{steps.tag_latest.outputs.value}} | |
name: BilibiliDown - v${{steps.tag_latest.outputs.value}} | |
body_path: ./.github/release.info | |
draft: false | |
prerelease: false | |
files: | | |
BilibiliDown.v${{steps.tag_latest.outputs.value}}.release.zip | |
BilibiliDown.v${{steps.tag_latest.outputs.value}}.release.zip.sha1 | |
BilibiliDown.v${{steps.tag_latest.outputs.value}}.win_x64_jre11.release.zip | |
BilibiliDown.v${{steps.tag_latest.outputs.value}}.win_x64_jre11.release.zip.sha1 | |
- name: Upload release to supabase | |
env: | |
VERSION_NUMBER: ${{ steps.tag_latest.outputs.value }} | |
SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }} | |
if: ${{ env.SUPABASE_ANON_KEY != ''}} | |
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: ${{ env.CLOUDINARY_API_KEY != '' && env.CLOUDINARY_API_SECRET != ''}} | |
run: | | |
chmod +x .github/scripts/upload_cloudinary.sh | |
./.github/scripts/upload_cloudinary.sh | |
- name: Sync Push to Gitee | |
env: | |
GITEE_AUTH: ${{ secrets.GITEE_AUTH }} | |
if: ${{ env.GITEE_AUTH != ''}} | |
run: | | |
chmod +x .github/scripts/sync_push_to_gitee.sh | |
./.github/scripts/sync_push_to_gitee.sh |