Skip to content

Commit

Permalink
Automate update version list daily
Browse files Browse the repository at this point in the history
  • Loading branch information
yanecc committed Jun 18, 2024
1 parent 0d8f5b2 commit cb5d0eb
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 5 deletions.
Binary file modified .github/UpdateVersionList
Binary file not shown.
13 changes: 8 additions & 5 deletions .github/UpdateVersionList.cr
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,20 @@ isUpdated = true
if vlist["ruby"][0] != latestHomebrewRuby
isUpdated = false
vlist["homebrew"].unshift(latestHomebrewRuby)
end

if vlist["jruby"] != fetchJRubyVersions
isUpdated = false
vlist["jruby"] = fetchJRubyVersions
puts "Homebrew Ruby has an updated version: #{latestHomebrewRuby}"
end

if vlist["truffleruby"][0] != latestTruffleRuby
isUpdated = false
vlist["truffleruby"].unshift(latestTruffleRuby)
vlist["truffleruby-jvm"].unshift(latestTruffleRuby + ".jvm")
puts "TruffleRuby has an updated version: #{latestTruffleRuby}"
end

if vlist["jruby"] != fetchJRubyVersions
isUpdated = false
vlist["jruby"] = fetchJRubyVersions
puts "JRuby version list is updated"
end

unless isUpdated
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/Update version list.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Check Updates Daily

on:
schedule:
- cron: "0 6 * * *"
push:
branches: ["main"]

jobs:
update-version-list:
runs-on: ubuntu-latest

steps:
- name: Download source
uses: actions/checkout@v4

- name: Check updates
id: check_updates
run: |
./.github/UpdateVersionList -o manifest.md
if [ -s manifest.md ]; then
HAS_UPDATES=true
echo "Updates found"
else
HAS_UPDATES=false
echo "Already up to date"
fi
echo "HAS_UPDATES=$HAS_UPDATES" >> $GITHUB_OUTPUT
- name: Update manifest body
if: ${{ steps.check_updates.outputs.HAS_UPDATES }}
uses: ncipollo/release-action@v1
with:
name: "manifest"
tag: "manifest"
allowUpdates: true
bodyFile: "manifest.md"
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true

0 comments on commit cb5d0eb

Please sign in to comment.