mirror of
https://github.com/yuliskov/SmartTube.git
synced 2026-03-13 15:20:26 +08:00
ci: Improve workflows
* Update GitHub Actions dependencies * Prevent cleanup workflow from running on forked repositories
This commit is contained in:
18
.github/workflows/CI.yml
vendored
18
.github/workflows/CI.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
||||
env:
|
||||
HAS_SIGNING_KEY: ${{ secrets.SIGNING_KEY != '' }}
|
||||
HAS_VT_KEY: ${{ secrets.VIRUS_TOTAL_API_KEY != '' }}
|
||||
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
@@ -49,19 +49,19 @@ jobs:
|
||||
- name: VirusTotal Scan
|
||||
if: ${{ env.HAS_VT_KEY == 'true' }}
|
||||
id: vt
|
||||
uses: crazy-max/ghaction-virustotal@v4
|
||||
uses: crazy-max/ghaction-virustotal@v5
|
||||
with:
|
||||
vt_api_key: ${{ secrets.VIRUS_TOTAL_API_KEY }}
|
||||
files: |
|
||||
./smarttubetv/build/outputs/apk/stbeta/release/*.apk
|
||||
request_rate: 3
|
||||
request_rate: 4
|
||||
|
||||
- name: VirusTotal Summary
|
||||
if: steps.vt.outcome == 'success'
|
||||
run: |
|
||||
echo "Waiting 150s for VirusTotal engines to report..."
|
||||
sleep 150
|
||||
|
||||
|
||||
echo "### Security Scan Results" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Artifact Name | VirusTotal Status | Detailed Report |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| :--- | :--- | :--- |" >> $GITHUB_STEP_SUMMARY
|
||||
@@ -69,7 +69,7 @@ jobs:
|
||||
for apk in ./smarttubetv/build/outputs/apk/stbeta/release/*.apk; do
|
||||
filename=$(basename "$apk")
|
||||
sha256=$(sha256sum "$apk" | awk '{print $1}')
|
||||
|
||||
|
||||
# Construct the dynamic badge URL using the hash
|
||||
badge_url="https://badges.cssnr.com/vt/id/$sha256?start=green&end=red&n=8"
|
||||
vt_link="https://www.virustotal.com/gui/file/$sha256"
|
||||
@@ -78,28 +78,28 @@ jobs:
|
||||
done
|
||||
|
||||
- name: Upload ARM64 APK
|
||||
uses: actions/upload-artifact@v6
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: SmartTube_${{ steps.get_version.outputs.VERSION_NAME }}_arm64
|
||||
path: ./smarttubetv/build/outputs/apk/stbeta/release/*_arm64-v8a.apk
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload ARMv7 APK
|
||||
uses: actions/upload-artifact@v6
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: SmartTube_${{ steps.get_version.outputs.VERSION_NAME }}_armeabi-v7a
|
||||
path: ./smarttubetv/build/outputs/apk/stbeta/release/*_armeabi-v7a.apk
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload Universal APK
|
||||
uses: actions/upload-artifact@v6
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: SmartTube_${{ steps.get_version.outputs.VERSION_NAME }}_universal
|
||||
path: ./smarttubetv/build/outputs/apk/stbeta/release/*_universal.apk
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload x86 APK
|
||||
uses: actions/upload-artifact@v6
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: SmartTube_${{ steps.get_version.outputs.VERSION_NAME }}_x86
|
||||
path: ./smarttubetv/build/outputs/apk/stbeta/release/*_x86.apk
|
||||
|
||||
4
.github/workflows/cleanup.yml
vendored
4
.github/workflows/cleanup.yml
vendored
@@ -8,10 +8,11 @@ on:
|
||||
jobs:
|
||||
cleanup:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.repository.fork == false
|
||||
permissions:
|
||||
actions: write
|
||||
steps:
|
||||
- uses: actions/github-script@v7
|
||||
- uses: actions/github-script@v8
|
||||
with:
|
||||
script: |
|
||||
const KEEP = 0;
|
||||
@@ -53,4 +54,3 @@ jobs:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
2
.github/workflows/stale.yml
vendored
2
.github/workflows/stale.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
actions: write
|
||||
issues: write
|
||||
steps:
|
||||
- uses: actions/stale@v10.2.0
|
||||
- uses: actions/stale@v10
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
operations-per-run: 3000 # This may result in rate limiting, could we reduce and run in batches?
|
||||
|
||||
6
.github/workflows/virustotal_scan.yml
vendored
6
.github/workflows/virustotal_scan.yml
vendored
@@ -31,7 +31,7 @@ jobs:
|
||||
echo -e "MARKER=\t\t\t" >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Download Release Assets
|
||||
env:
|
||||
@@ -43,12 +43,12 @@ jobs:
|
||||
- name: VirusTotal Scan
|
||||
if: ${{ env.HAS_VT_KEY == 'true' }}
|
||||
id: vt
|
||||
uses: crazy-max/ghaction-virustotal@v4
|
||||
uses: crazy-max/ghaction-virustotal@v5
|
||||
with:
|
||||
vt_api_key: ${{ secrets.VIRUS_TOTAL_API_KEY }}
|
||||
files: |
|
||||
release_assets/*.apk
|
||||
request_rate: 3
|
||||
request_rate: 4
|
||||
|
||||
- name: Generate Custom Badge Report
|
||||
if: steps.vt.outcome == 'success'
|
||||
|
||||
Reference in New Issue
Block a user