Always save cache (#451)
Always save cache, even if one of the scripts returned an error. Also use a workflow to clear the cache instead of relying on josStorer/get-current-time@v2.
This commit is contained in:
18
.github/workflows/clear-cache.yml
vendored
Normal file
18
.github/workflows/clear-cache.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
name: Clear Cache
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * 1' # Every Monday at 00:00 UTC
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
clear-cache:
|
||||||
|
name: Clear Cache
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Clear all caches
|
||||||
|
run: gh cache delete --all --succeed-on-no-caches
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
OWNER: ${{ github.repository_owner }}
|
||||||
|
REPO: ${{ github.event.repository.name }}
|
||||||
27
.github/workflows/update.yml
vendored
27
.github/workflows/update.yml
vendored
@@ -18,20 +18,14 @@ jobs:
|
|||||||
name: Update data
|
name: Update data
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Get current week
|
# Note that the cache will be destroyed every week by .github/workflows/clear-cache.yml.
|
||||||
uses: josStorer/get-current-time@v2
|
# See https://github.com/actions/cache/tree/main/save#always-save-cache.
|
||||||
id: current-time
|
- name: Restore repositories and HTTP requests cache
|
||||||
with:
|
id: cache-restore
|
||||||
format: YYYY-ww # 2022-01 to 2022-52 for eg
|
uses: actions/cache/restore@v4
|
||||||
|
|
||||||
- name: Cache fetched repositories and HTTP requests
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
with:
|
||||||
|
key: 'update-cache'
|
||||||
path: ~/.cache
|
path: ~/.cache
|
||||||
# The cache is reset on the first build of every week this way. If you wish to reset the cache manually,
|
|
||||||
# you can do it on https://github.com/endoflife-date/release-data/actions/caches or by updating
|
|
||||||
# the last part of the key below.
|
|
||||||
key: "${{ steps.current-time.outputs.formattedTime }}-2"
|
|
||||||
|
|
||||||
- name: Clone self repository
|
- name: Clone self repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -76,6 +70,15 @@ jobs:
|
|||||||
commit_message: ${{ steps.update_data.outputs.commit_message }}
|
commit_message: ${{ steps.update_data.outputs.commit_message }}
|
||||||
commit_author: 'github-actions[bot] <github-actions[bot]@users.noreply.github.com>'
|
commit_author: 'github-actions[bot] <github-actions[bot]@users.noreply.github.com>'
|
||||||
|
|
||||||
|
# See https://github.com/actions/cache/tree/main/save#always-save-cache.
|
||||||
|
- name: Save repositories and HTTP requests cache
|
||||||
|
id: cache-save
|
||||||
|
uses: actions/cache/save@v4
|
||||||
|
if: always() && steps.cache-restore.outputs.cache-hit != 'true'
|
||||||
|
with:
|
||||||
|
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
|
||||||
|
path: ~/.cache
|
||||||
|
|
||||||
# we still want to easily know if something went wrong
|
# we still want to easily know if something went wrong
|
||||||
- name: Restore update.py failure
|
- name: Restore update.py failure
|
||||||
if: steps.update_data.outcome != 'success'
|
if: steps.update_data.outcome != 'success'
|
||||||
|
|||||||
@@ -1,6 +1,22 @@
|
|||||||
{
|
{
|
||||||
"releases": {},
|
"releases": {},
|
||||||
"versions": {
|
"versions": {
|
||||||
|
"4.15.53": {
|
||||||
|
"name": "4.15.53",
|
||||||
|
"date": "2025-06-26"
|
||||||
|
},
|
||||||
|
"4.18.18": {
|
||||||
|
"name": "4.18.18",
|
||||||
|
"date": "2025-06-25"
|
||||||
|
},
|
||||||
|
"4.17.34": {
|
||||||
|
"name": "4.17.34",
|
||||||
|
"date": "2025-06-25"
|
||||||
|
},
|
||||||
|
"4.19.1": {
|
||||||
|
"name": "4.19.1",
|
||||||
|
"date": "2025-06-24"
|
||||||
|
},
|
||||||
"4.19.0": {
|
"4.19.0": {
|
||||||
"name": "4.19.0",
|
"name": "4.19.0",
|
||||||
"date": "2025-06-17"
|
"date": "2025-06-17"
|
||||||
|
|||||||
Reference in New Issue
Block a user