Skip to content

Commit 3b04d8e

Browse files
committed
workflow: update release logic
1 parent ec941e5 commit 3b04d8e

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

.github/workflows/firmware.yaml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ env:
4040
TG_CHANNEL_SCRATCH: ${{secrets.TELEGRAM_CHANNEL_THINGINO_SCRATCH}}
4141
TG_OPTIONS: -s
4242
FORCE_UNSAFE_CONFIGURE: 1
43+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4344

4445
jobs:
4546
notify-begin:
@@ -119,7 +120,7 @@ jobs:
119120
120121
- name: Install build dependencies
121122
run: |
122-
apt-get install -y --no-install-recommends --no-install-suggests build-essential bc cmake cpio curl ca-certificates file git make gawk procps rsync u-boot-tools unzip wget
123+
apt-get install -y --no-install-recommends --no-install-suggests build-essential bc cmake cpio curl ca-certificates file git make gawk jq procps rsync u-boot-tools unzip wget
123124
124125
- name: Setup gh workspace in container
125126
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
@@ -224,7 +225,7 @@ jobs:
224225
uses: softprops/action-gh-release@master
225226
with:
226227
tag_name: ${{ env.TAG_NAME }}
227-
make_latest: true
228+
make_latest: false
228229
files: |
229230
${{ env.FULL_FW }}
230231
${{ env.FULL_FW_SHA }}
@@ -265,6 +266,25 @@ jobs:
265266
- name: Setup Environment
266267
run: |
267268
echo "TG_DISABLED=${{ github.event.inputs.tg_disabled || 'false' }}" >> $GITHUB_ENV
269+
echo "TAG_NAME=$TAG_NAME-$(date +'%Y-%m-%d')" >> $GITHUB_ENV
270+
271+
- name: Checkout source
272+
uses: actions/checkout@v4
273+
with:
274+
submodules: 'true'
275+
ref: "master"
276+
fetch-depth: "1"
277+
278+
- name: Get release ID and Mark as Latest
279+
run: |
280+
RELEASE_URL=$(gh release view ${{ env.TAG_NAME }} --json url -q ".url")
281+
282+
if [[ -n "$RELEASE_URL" ]]; then
283+
gh release edit ${{ env.TAG_NAME }} --prerelease false --draft false --latest true
284+
echo "Release marked as latest"
285+
else
286+
echo "Release not found, skipping latest release update"
287+
fi
268288
269289
- name: Send completion summary
270290
if: ${{ env.TG_DISABLED == 'false' }}

0 commit comments

Comments
 (0)