Check update #771
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
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/[email protected] | |
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/[email protected] | |
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 |