-
Notifications
You must be signed in to change notification settings - Fork 281
104 lines (88 loc) · 3.29 KB
/
release.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# 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