-
Notifications
You must be signed in to change notification settings - Fork 8
42 lines (38 loc) · 1.61 KB
/
sync-version-with-upstream.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
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: |
# Grabbing latest release
VERSION=$(curl -sL https://api.github.com/repos/jenkinsci/jenkins/releases | jq .[].tag_name -r | grep -v rc | sort -r | head -n 1 | cut -d "-" -f2)
sed -i 's/^\(version: \).*$/\1'"'$VERSION'"'/' snap/snapcraft.yaml
sync-lts:
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:
branch: lts
token: ${{ secrets.SNAPCRAFTERS_BOT_COMMIT }}
update-script: |
# Grabbing latest lts release
VERSION=$(curl -s https://api.github.com/repos/jenkinsci/jenkins/releases | jq '.[] | select(.body | test("lts")) | select(.tag_name | test("rc") | not) | {name, tag_name, published_at}'| jq -s 'sort_by(.tag_name) | reverse | .[0]' | grep -w name | awk '{print $2}' | tr -d '"' | cut -d "," -f1)
sed -i 's/^\(version: \).*$/\1'"'$VERSION'"'/' snap/snapcraft.yaml