-
-
Notifications
You must be signed in to change notification settings - Fork 175
94 lines (84 loc) · 2.79 KB
/
update.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
name: Check update
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
check:
name: Check update
if: github.repository == 'YT-Advanced/WSA-Script'
runs-on: ubuntu-latest
steps:
- name: Checkout ♻️
uses: actions/checkout@v4
- name: Install Dependencies 🧑🏭
run: |
pip3 install requests
- name: Get app version ✅
working-directory: scripts
run: python3 WSAUpdateChecker.py
env:
API_KEY: ${{ secrets.API_KEY }}
- name: Update App version 🔗
uses: stefanzweifel/git-auto-commit-action@v5
if: env.SHOULD_BUILD == 'yes'
with:
branch: update
push_options: '--force'
file_pattern: '*.appversion'
commit_message: ${{ env.MSG }}
create_branch: true
- name: Prepare release tag 🏷️
if: env.SHOULD_BUILD == 'yes'
id: date
shell: bash
run: |
if [[ "${{ env.RELEASE_TYPE }}" == "WIF" ]]; then
echo "tag=WSA-Insider-Version" >> $GITHUB_OUTPUT
echo "prerls=true" >> $GITHUB_OUTPUT
else
echo "tag=$(date +'v%Y-%m-%d')" >> $GITHUB_OUTPUT
echo "prerls=false" >> $GITHUB_OUTPUT
fi
- name: Delete Tag (if exist) ❌
if: steps.date.outputs.tag == 'WSA-Insider-Version'
uses: dev-drprasad/delete-tag-and-release@v1.1
with:
tag_name: ${{ steps.date.outputs.tag }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Add text format to release 📝
if: env.SHOULD_BUILD == 'yes'
uses: softprops/action-gh-release@v2.2.1
with:
tag_name: ${{ steps.date.outputs.tag }}
body: "# Changelog\n## ${{ env.MSG }}\n### SHA256 Checksum\n```"
prerelease: ${{ steps.date.outputs.prerls }}
draft: false
- name: Delete old workflow run ❌
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 0
keep_minimum_runs: 0
delete_workflow_pattern: "Check update"
outputs:
SHOULD_BUILD: ${{ env.SHOULD_BUILD }}
RELEASE_TYPE: ${{ env.RELEASE_TYPE }}
build:
name: ${{ matrix.arch }}-${{ matrix.root }}-${{ matrix.gapps }}
strategy:
matrix:
arch: [x64, arm64]
root: [magisk, kernelsu, none]
gapps: [MindTheGapps, none]
permissions: write-all
needs: check
uses: ./.github/workflows/build.yml
if: needs.check.outputs.SHOULD_BUILD == 'yes'
with:
arch: ${{ matrix.arch }}
gapps: ${{ matrix.gapps }}
root: ${{ matrix.root }}
release_type: ${{ needs.check.outputs.RELEASE_TYPE }}
secrets: inherit