Skip to content

Commit 5f3f5fd

Browse files
authored
Update action.yml (#6)
* Update action.yml * Update armbian/build action version to v25.08 * Update action.yml * Add delete old releases action * Switch do SDK branch to tune up
1 parent 1101a2b commit 5f3f5fd

File tree

3 files changed

+43
-3
lines changed

3 files changed

+43
-3
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/workflows/action.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
actions: write
1616
steps:
1717
# checkout this repository
18-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@v5
1919
# prevent GitHub from suspending cronjob
2020
- uses: liskin/gh-workflow-keepalive@v1
2121

@@ -29,17 +29,18 @@ jobs:
2929
extension: [",image-output-qcow2",""]
3030

3131
name: "${{ matrix.os }},${{ matrix.board }}${{ matrix.extension }}"
32-
runs-on: ubuntu-latest
32+
runs-on: images
3333
steps:
3434

35-
- uses: armbian/build@v23.11.2
35+
- uses: armbian/build@sdk
3636
with:
3737
# mandatory
3838
armbian_token: "${{ secrets.GITHUB_TOKEN }}" # GitHub installation access token
3939
armbian_target: "armbian-images" # build configuration from userpatches
4040
armbian_release: "${{ matrix.os }}" # userspace: jammy, bookworm, trixie, etc.
4141
armbian_board: "${{ matrix.board }}" # board build target
4242
# optional
43+
armbian_release_clean: "true"
4344
armbian_extensions: "docker-ce,sdk${{ matrix.extension }}" # enable extensions
4445
armbian_release_tittle: "Armbian SDK" # release tittle
4546
armbian_release_body: "Virtual images for x86 and arm64" # release body
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Delete Old Releases
2+
3+
on:
4+
schedule:
5+
- cron: '0 3 * * *' # Daily at 03:00 UTC
6+
workflow_dispatch: # Manual trigger
7+
8+
jobs:
9+
clean_releases:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Delete old releases
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
run: |
16+
# Get all releases (handle pagination)
17+
releases=$(gh api --paginate repos/${{ github.repository }}/releases)
18+
19+
# Process full releases
20+
full_releases=$(echo "$releases" | jq -c '[.[] | select(.prerelease == false)] | sort_by(.created_at) | reverse')
21+
full_to_delete=$(echo "$full_releases" | jq '.[3:] | .[].id')
22+
for id in $full_to_delete; do
23+
echo "Deleting old full release ID: $id"
24+
gh api --method DELETE repos/${{ github.repository }}/releases/$id
25+
done
26+
27+
# Process pre-releases
28+
pre_releases=$(echo "$releases" | jq -c '[.[] | select(.prerelease == true)] | sort_by(.created_at) | reverse')
29+
pre_to_delete=$(echo "$pre_releases" | jq '.[3:] | .[].id')
30+
for id in $pre_to_delete; do
31+
echo "Deleting old pre-release ID: $id"
32+
gh api --method DELETE repos/${{ github.repository }}/releases/$id
33+
done

0 commit comments

Comments
 (0)