mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-23 13:36:35 +00:00
Show the yt-dlp-latest-release
This commit is contained in:
parent
72ba0474a3
commit
085c64d95d
19
.github/workflows/ci.yaml
vendored
19
.github/workflows/ci.yaml
vendored
@ -15,6 +15,7 @@ jobs:
|
|||||||
outputs:
|
outputs:
|
||||||
ffmpeg-releases: ${{ steps.ffmpeg.outputs.releases }}
|
ffmpeg-releases: ${{ steps.ffmpeg.outputs.releases }}
|
||||||
string-lowercase: ${{ steps.string.outputs.lowercase }}
|
string-lowercase: ${{ steps.string.outputs.lowercase }}
|
||||||
|
ytdlp-latest-release: ${{ steps.yt-dlp.outputs.latest-release }}
|
||||||
ytdlp_tag: ${{ steps.set.outputs.ytdlp_tag }}
|
ytdlp_tag: ${{ steps.set.outputs.ytdlp_tag }}
|
||||||
steps:
|
steps:
|
||||||
- name: Lowercase github username for ghcr
|
- name: Lowercase github username for ghcr
|
||||||
@ -60,11 +61,12 @@ jobs:
|
|||||||
GH_API_GQL_OWNER: yt-dlp
|
GH_API_GQL_OWNER: yt-dlp
|
||||||
GH_API_GQL_REPO: yt-dlp
|
GH_API_GQL_REPO: yt-dlp
|
||||||
run: |
|
run: |
|
||||||
gql_query='query($repo: String!, $owner: String!, $releases: Int!) { repository(owner: $owner, name: $repo) { releases(first: $releases, orderBy: { field: CREATED_AT, direction: DESC }) { nodes { name, createdAt, publishedAt, updatedAt, description, url, isDraft, isPrerelease, isLatest, tag { name, target { oid, commitUrl } } } } } }' ;
|
mk_delim() { printf -- '"%s_EOF_%d_"' "$1" "${RANDOM}" ; } ;
|
||||||
|
gql_query='query($repo: String!, $owner: String!, $releases: Int!) { repository(owner: $owner, name: $repo) { releases(first: $releases, orderBy: { field: CREATED_AT, direction: DESC }) { nodes { name, createdAt, publishedAt, updatedAt, url, isDraft, isPrerelease, isLatest, tag { name, target { oid, commitUrl } } } } } }' ;
|
||||||
gql_jq='[ .data.repository.releases.nodes[] | select((.isDraft or .isPrerelease) | not) | del(.isDraft, .isPrerelease) ]' ;
|
gql_jq='[ .data.repository.releases.nodes[] | select((.isDraft or .isPrerelease) | not) | del(.isDraft, .isPrerelease) ]' ;
|
||||||
{
|
{
|
||||||
var='releases' ;
|
var='releases' ;
|
||||||
delim='"'"${var}"'_EOF"' ;
|
delim="$(mk_delim "${var}")" ;
|
||||||
printf -- '%s<<%s\n' "${var}" "${delim}" ;
|
printf -- '%s<<%s\n' "${var}" "${delim}" ;
|
||||||
gh api graphql --cache 12h \
|
gh api graphql --cache 12h \
|
||||||
-F owner="${GH_API_GQL_OWNER}" \
|
-F owner="${GH_API_GQL_OWNER}" \
|
||||||
@ -72,6 +74,16 @@ jobs:
|
|||||||
-F releases="${GH_API_GQL_RELEASES}" \
|
-F releases="${GH_API_GQL_RELEASES}" \
|
||||||
-f query="${gql_query}" --jq "${gql_jq}" ;
|
-f query="${gql_query}" --jq "${gql_jq}" ;
|
||||||
printf -- '%s\n' "${delim}" ;
|
printf -- '%s\n' "${delim}" ;
|
||||||
|
jq_arg='map(select(.isLatest))' ;
|
||||||
|
var='latest-release' ;
|
||||||
|
delim="$(mk_delim "${var}")" ;
|
||||||
|
printf -- '%s<<%s\n' "${var}" "${delim}" ;
|
||||||
|
gh api graphql --cache 12h \
|
||||||
|
-F owner="${GH_API_GQL_OWNER}" \
|
||||||
|
-F repo="${GH_API_GQL_REPO}" \
|
||||||
|
-F releases="${GH_API_GQL_RELEASES}" \
|
||||||
|
-f query="${gql_query}" --jq "${gql_jq}" | jq -c "${jq_arg}" -- ;
|
||||||
|
printf -- '%s\n' "${delim}" ;
|
||||||
unset -v delim jq_arg var ;
|
unset -v delim jq_arg var ;
|
||||||
} >> "${GITHUB_OUTPUT}"
|
} >> "${GITHUB_OUTPUT}"
|
||||||
gh api graphql --cache 12h \
|
gh api graphql --cache 12h \
|
||||||
@ -83,6 +95,9 @@ jobs:
|
|||||||
- name: Set outputs
|
- name: Set outputs
|
||||||
id: set
|
id: set
|
||||||
run: |
|
run: |
|
||||||
|
cat <<'EOF'
|
||||||
|
${{ toJSON(fromJSON(steps.yt-dlp.outputs.latest-release)) }}
|
||||||
|
'EOF'
|
||||||
printf -- '%s=%s\n' >> "${GITHUB_OUTPUT}" \
|
printf -- '%s=%s\n' >> "${GITHUB_OUTPUT}" \
|
||||||
'ytdlp_tag' "$(< tag-yt-dlp)"
|
'ytdlp_tag' "$(< tag-yt-dlp)"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user