Skip to content

Update

Update #58

Workflow file for this run

name: Update
on:
# Runs at 10:00 UTC every day
schedule:
- cron: '0 10 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
sync:
name: Sync version with upstream
environment: "Candidate Branch"
runs-on: ubuntu-latest
steps:
- name: Sync version with upstream
uses: snapcrafters/ci/sync-version@main
with:
token: ${{ secrets.SNAPCRAFTERS_BOT_COMMIT }}
update-script: |
source_url="$(curl -sL https://developer.android.com/studio/index.html | grep -Eo '"((https)?://.*linux.tar.gz)"' | tr -d '"')"
codename="$(curl -sL https://developer.android.com/studio/index.html | grep -Po 'Download Android Studio (?!today)[A-Za-z0-9]+' | head -n1 | cut -d ' ' -f4)"
version="$(basename "$source_url" .tar.gz | grep -oP '\d+\.\d+\.\d+\.\d+')-$codename"
sed -i "s|source: .*$|source: $source_url|g" snap/snapcraft.yaml
sed -i 's/^\(version: \).*$/\1'"\"$version\""'/' snap/snapcraft.yaml