Skip to content

Commit

Permalink
Merge pull request #54 from kz6fittycent/candidate
Browse files Browse the repository at this point in the history
Logic for upstream version sync added
  • Loading branch information
jnsgruk committed Dec 15, 2023
2 parents f29e514 + 526cb9c commit 36ec41c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/sync-version-with-upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ jobs:
with:
token: ${{ secrets.SNAPCRAFTERS_BOT_COMMIT }}
update-script: |
#!/bin/bash
# Update the snapcraft.yaml to match upstream version
API="https://api.github.com/repos/jenkinsci/jenkins/releases/latest"
VERSION=$(curl -s "${API}" | grep -i name | awk 'FNR == 3 {print $2}' | cut -d ',' -f1)
sed -i 's/^\(version: \).*$/\1'"$VERSION"'/' snap/snapcraft.yaml
VERSION=$(curl -s "${API}" | grep -i name | awk 'FNR == 3 {print $2}' | cut -d ',' -f1 | sed 's/"//g')
CRAFT=$(grep -i version snap/snapcraft.yaml | awk '{print $2}' | sed 's/"//g')
# Running checks here
if [[ "${CRAFT}" < "${VERSION}" ]]; then
sed -i 's/^\(version: \).*$/\1'"'$VERSION'"'/' snap/snapcraft.yaml
fi
4 changes: 2 additions & 2 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ issues: https://github.com/snapcrafters/jenkins/issues
source-code: https://github.com//snapcrafters/jenkins
license: MIT
icon: snap/local/jenkins.png
version: "2.426.2"
version: '2.436'

base: core22
confinement: classic
Expand All @@ -40,7 +40,7 @@ parts:
jenkins:
plugin: nil
source: https://github.com/jenkinsci/jenkins.git
source-tag: jenkins-$SNAPCRAFT_PROJECT_VERSION
source-tag: jenkins-$SNAPCRAFT_PROJECT_VERSION
stage-packages:
- fonts-dejavu-core
- libfontconfig1
Expand Down

0 comments on commit 36ec41c

Please sign in to comment.