Skip to content

Commit 51172cb

Browse files
authored
Update publish-acs-esp-miner-firmware.yml
1 parent 79c03c5 commit 51172cb

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

.github/workflows/publish-acs-esp-miner-firmware.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ permissions:
55
contents: read
66

77
on:
8+
workflow_dispatch:
9+
inputs:
10+
asset_name:
11+
description: 'Name of the asset to upload (e.g. esp-miner.bin)'
12+
required: true
13+
default: esp-miner.bin
814
release:
915
types: [published]
1016

@@ -28,14 +34,19 @@ jobs:
2834
aws-region: ${{ env.AWS_REGION }}
2935

3036
- name: Determine asset name
31-
id: asset
3237
run: |
33-
ASSET_NAME=$(basename "${{ github.event.release.assets[0].name }}")
34-
echo "ASSET_NAME=$ASSET_NAME" >> $GITHUB_ENV
38+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
39+
echo "ASSET_NAME=${{ github.event.inputs.asset_name }}" >> $GITHUB_ENV
40+
else
41+
echo "ASSET_NAME=${{ github.event.release.assets[0].name }}" >> $GITHUB_ENV
42+
fi
43+
44+
- name: Print asset name (debug)
45+
run: echo "Using asset: $ASSET_NAME"
3546

3647
- name: Download release asset
3748
run: |
38-
URL="https://github.com/${REPO}/releases/download/${{ github.event.release.tag_name }}/${ASSET_NAME}"
49+
URL="https://github.com/${REPO}/releases/download/${{ github.event.release.tag_name || 'latest' }}/$ASSET_NAME"
3950
echo "Downloading $URL"
4051
curl -L -o "$ASSET_NAME" "$URL"
4152

0 commit comments

Comments
 (0)