Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correcting update logic #57

Merged
merged 4 commits into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions .github/workflows/sync-version-with-upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ 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 '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
# 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
2 changes: 1 addition & 1 deletion 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.435'

base: core22
confinement: classic
Expand Down
Loading