mirror of
https://github.com/theupriser/steamify-cachyos-live-iso.git
synced 2026-10-02 15:10:26 +02:00
feat(ci): ISOs are named by the day like CachyOS (steamify-cachyos-<ver>-<YYMMDD>), one per day and kind, at most 10 dev and 10 real releases kept
Sync git.upriser.nl mirror / sync (push) Skipped
Sync git.upriser.nl mirror / sync (push) Skipped
This commit is contained in:
1 parent
38ac8f1cba
commit
588627a14d
4 files changed
+53
-25
No files matched your search
@@ -60,13 +60,13 @@ jobs:
|
||||
id: tag
|
||||
run: |
|
||||
tag="${{ github.ref_name }}"
|
||||
[[ "$tag" =~ ^v([0-9]+\.[0-9]+\.[0-9]+)-(dev\.)?([0-9]{4})\.([0-9]{2})\.([0-9]{2})-([0-9]{4})$ ]] ||
|
||||
{ echo "::error::$tag is not a Steamify ISO release tag (v<steamify>-[dev.]<YYYY.MM.DD>-<HHMM>)"; exit 1; }
|
||||
[[ "$tag" =~ ^v([0-9]+\.[0-9]+\.[0-9]+)-(dev-)?([0-9]{6})$ ]] ||
|
||||
{ echo "::error::$tag is not a Steamify ISO release tag (v<steamify>-[dev-]<YYMMDD>)"; exit 1; }
|
||||
m=("${BASH_REMATCH[@]}")
|
||||
{
|
||||
echo "STEAMIFY_VERSION=${m[1]}"
|
||||
# One moment for the ISO's label (profiledef.sh) and the release's name: the tag's (UTC).
|
||||
echo "STEAMIFY_BUILD_STAMP=${m[3]}${m[4]}${m[5]}_${m[6]}"
|
||||
# The day (YYMMDD, UTC) for the ISO's label (profiledef.sh) and the release's name: the tag's.
|
||||
echo "STEAMIFY_BUILD_STAMP=${m[3]}"
|
||||
echo "ISO_PRERELEASE=$([ -n "${m[2]}" ] && echo true || echo false)"
|
||||
# The ISO's file name: the tag without its v (profiledef.sh).
|
||||
echo "STEAMIFY_ISO_VERSION=${tag#v}"
|
||||
@@ -119,13 +119,13 @@ jobs:
|
||||
- name: Version and time from the tag
|
||||
run: |
|
||||
tag="${{ github.ref_name }}"
|
||||
[[ "$tag" =~ ^v([0-9]+\.[0-9]+\.[0-9]+)-(dev\.)?([0-9]{4})\.([0-9]{2})\.([0-9]{2})-([0-9]{4})$ ]] ||
|
||||
{ echo "::error::$tag is not a Steamify ISO release tag (v<steamify>-[dev.]<YYYY.MM.DD>-<HHMM>)"; exit 1; }
|
||||
[[ "$tag" =~ ^v([0-9]+\.[0-9]+\.[0-9]+)-(dev-)?([0-9]{6})$ ]] ||
|
||||
{ echo "::error::$tag is not a Steamify ISO release tag (v<steamify>-[dev-]<YYMMDD>)"; exit 1; }
|
||||
m=("${BASH_REMATCH[@]}")
|
||||
{
|
||||
echo "STEAMIFY_VERSION=${m[1]}"
|
||||
# One moment for the ISO's label (profiledef.sh) and the release's name: the tag's (UTC).
|
||||
echo "STEAMIFY_BUILD_STAMP=${m[3]}${m[4]}${m[5]}_${m[6]}"
|
||||
# The day (YYMMDD, UTC) for the ISO's label (profiledef.sh) and the release's name: the tag's.
|
||||
echo "STEAMIFY_BUILD_STAMP=${m[3]}"
|
||||
echo "ISO_PRERELEASE=$([ -n "${m[2]}" ] && echo true || echo false)"
|
||||
# The ISO's file name: the tag without its v (profiledef.sh).
|
||||
echo "STEAMIFY_ISO_VERSION=${tag#v}"
|
||||
@@ -145,18 +145,17 @@ jobs:
|
||||
iso="$(ls out/desktop/*.iso | head -n 1)"
|
||||
[ -f "$iso" ] || { echo "::error::no ISO in out/desktop"; exit 1; }
|
||||
tag="${{ github.ref_name }}" b="$STEAMIFY_BUILD_STAMP"
|
||||
stamp="${b:0:4}.${b:4:2}.${b:6:2}-${b:9:4}"
|
||||
stamp="20${b:0:2}.${b:2:2}.${b:4:2}"
|
||||
if [ "$ISO_PRERELEASE" = true ]; then
|
||||
name="CachyOS with Steamify Live ISO $STEAMIFY_VERSION (test build $stamp UTC)"
|
||||
else
|
||||
name="CachyOS with Steamify Live ISO $STEAMIFY_VERSION ($stamp UTC)"
|
||||
fi
|
||||
# Never overwritten: a release for this tag that already has the ISO is left alone.
|
||||
# One ISO per day and kind: a release of this tag from an earlier build of the day is replaced.
|
||||
api="${{ github.server_url }}/api/v1/repos/${{ github.repository }}"
|
||||
if curl -fsS -H "Authorization: token $TOKEN" "$api/releases/tags/$tag" -o /tmp/rel.json &&
|
||||
[ "$(jq '[.assets[] | select(.name | endswith(".iso"))] | length' /tmp/rel.json)" -gt 0 ]; then
|
||||
echo "::warning::$tag already has its ISO and won't be overwritten."
|
||||
echo "publish=false" >> "$GITHUB_OUTPUT"; exit 0
|
||||
if curl -fsS -H "Authorization: token $TOKEN" "$api/releases/tags/$tag" -o /tmp/rel.json; then
|
||||
echo "Replacing the earlier release of $tag"
|
||||
curl -fsS -X DELETE -H "Authorization: token $TOKEN" "$api/releases/$(jq -r .id /tmp/rel.json)" || true
|
||||
fi
|
||||
{ echo "publish=true"; echo "name=$name"; } >> "$GITHUB_OUTPUT"
|
||||
section="$(awk '/^## CachyOS with Steamify Live ISO/ {found = 1; next} found && /^#/ {exit} found' CHANGELOG.md)"
|
||||
|
||||
Reference in new issue
Block a user