Skip to content

Commit a0a12a1

Browse files
Automatically determine pre-releases
1 parent dcd4ce3 commit a0a12a1

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
env:
99
PROJECT_NAME: "arduino-flasher-cli"
1010
DIST_DIR: build
11+
# The project's folder on Arduino's download server for uploading builds
12+
AWS_PLUGIN_TARGET: /arduino-flasher-cli/
13+
AWS_REGION: "us-east-1"
1114

1215
jobs:
1316
build:
@@ -276,10 +279,31 @@ jobs:
276279
merge-multiple: true
277280
path: ${{ env.DIST_DIR }}
278281

282+
- name: Identify Prerelease
283+
# This is a workaround while waiting for create-release action
284+
# to implement auto pre-release based on tag
285+
id: prerelease
286+
run: |
287+
wget \
288+
-q \
289+
-P /tmp https://github.com/fsaintjacques/semver-tool/archive/3.2.0.zip
290+
291+
unzip \
292+
-p /tmp/3.2.0.zip semver-tool-3.2.0/src/semver \
293+
>/tmp/semver
294+
295+
chmod \
296+
+x \
297+
/tmp/semver
298+
299+
if [[ "$(/tmp/semver get prerel "${GITHUB_REF/refs\/tags\//}")" ]]; then
300+
echo "IS_PRE=true" >>$GITHUB_OUTPUT
301+
fi
302+
279303
- name: Upload artifacts index
280304
uses: ncipollo/release-action@v1
281305
with:
282306
token: ${{ secrets.GITHUB_TOKEN }}
283307
draft: false
284-
prerelease: true
308+
prerelease: ${{ steps.prerelease.outputs.IS_PRE }}
285309
artifacts: ${{ env.DIST_DIR }}/*

0 commit comments

Comments
 (0)