Skip to content

Commit

Permalink
workflow: update release logic
Browse files Browse the repository at this point in the history
  • Loading branch information
gtxaspec committed Nov 21, 2024
1 parent ec941e5 commit 3b04d8e
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/firmware.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ env:
TG_CHANNEL_SCRATCH: ${{secrets.TELEGRAM_CHANNEL_THINGINO_SCRATCH}}
TG_OPTIONS: -s
FORCE_UNSAFE_CONFIGURE: 1
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
notify-begin:
Expand Down Expand Up @@ -119,7 +120,7 @@ jobs:
- name: Install build dependencies
run: |
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
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
- name: Setup gh workspace in container
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
Expand Down Expand Up @@ -224,7 +225,7 @@ jobs:
uses: softprops/action-gh-release@master
with:
tag_name: ${{ env.TAG_NAME }}
make_latest: true
make_latest: false
files: |
${{ env.FULL_FW }}
${{ env.FULL_FW_SHA }}
Expand Down Expand Up @@ -265,6 +266,25 @@ jobs:
- name: Setup Environment
run: |
echo "TG_DISABLED=${{ github.event.inputs.tg_disabled || 'false' }}" >> $GITHUB_ENV
echo "TAG_NAME=$TAG_NAME-$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Checkout source
uses: actions/checkout@v4
with:
submodules: 'true'
ref: "master"
fetch-depth: "1"

- name: Get release ID and Mark as Latest
run: |
RELEASE_URL=$(gh release view ${{ env.TAG_NAME }} --json url -q ".url")
if [[ -n "$RELEASE_URL" ]]; then
gh release edit ${{ env.TAG_NAME }} --prerelease false --draft false --latest true
echo "Release marked as latest"
else
echo "Release not found, skipping latest release update"
fi
- name: Send completion summary
if: ${{ env.TG_DISABLED == 'false' }}
Expand Down

0 comments on commit 3b04d8e

Please sign in to comment.