-
Notifications
You must be signed in to change notification settings - Fork 35
29 lines (26 loc) · 1.02 KB
/
sync-upstream.yml
File metadata and controls
29 lines (26 loc) · 1.02 KB
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
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: |
FOLDER=https://ppa.launchpadcontent.net/obsproject/obs-studio/ubuntu/pool/main/o/obs-studio/
DISTRO_CODE=noble
DEB_URL=${FOLDER}$(curl -s "${FOLDER}" | grep "${DISTRO_CODE}" | grep -oP 'href="[^"]+\.deb"' | cut -d'"' -f2 | sort -V | tail -n 1)
VERSION="$(basename "$DEB_URL" | sed -E 's/^[^_]+_([0-9]+\.[0-9]+\.[0-9]+)-.*$/\1/')"
sed -i 's/^\(version: \).*$/\1'\"$VERSION\"'/' snap/snapcraft.yaml