fix mediamtx-rpicamera automatic updater (#3894)

This commit is contained in:
Alessandro Ros 2024-10-20 16:39:55 +02:00 committed by GitHub
parent 7c4849eb1e
commit b84ee99866
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -23,19 +23,19 @@ jobs:
script: | script: |
const fs = require('fs').promises; const fs = require('fs').promises;
// get last tag // get last release
let curTag = null; let curRelease = null;
for (let i = 1; i < 20; i++) { for (let i = 1; i < 20; i++) {
const tags = await github.rest.repos.listTags({ const releases = await github.rest.repos.listReleases({
owner: 'bluenviron', owner: 'bluenviron',
repo: 'mediamtx-rpicamera', repo: 'mediamtx-rpicamera',
page: i, page: i,
}); });
for (const tag of tags.data) { for (const release of releases.data) {
curTag = tag; curRelease = release;
break; break;
} }
if (curTag !== null) { if (curRelease !== null) {
break; break;
} }
} }
@ -44,7 +44,7 @@ jobs:
await fs.writeFile('internal/staticsources/rpicamera/mtxrpicamdownloader/VERSION', curRelease['tag_name'] + '\n', 'utf-8'); await fs.writeFile('internal/staticsources/rpicamera/mtxrpicamdownloader/VERSION', curRelease['tag_name'] + '\n', 'utf-8');
// make version available to next steps // make version available to next steps
core.exportVariable('VERSION', curTag.name); core.exportVariable('VERSION', curRelease.name);
- id: check_repo - id: check_repo
run: > run: >