|
1 | 1 | #!/bin/bash
|
2 | 2 |
|
3 |
| -# Extract the release name from a release |
4 | 3 |
|
5 |
| -# Default to draft tag name |
6 |
| -ver=$(basename $(jq -e -r '.ref' "$GITHUB_EVENT_PATH")) |
7 |
| -# If not available, try the publish tag name |
8 |
| -if [ "$ver" == "null" ]; then |
9 |
| - ver=$(jq -e -r '.release.tag_name' "$GITHUB_EVENT_PATH") |
10 |
| -fi |
11 |
| -# Fall back to the git description OTW (i.e. interactive) |
12 |
| -if [ "$ver" == "null" ]; then |
13 |
| - ver=$(git describe --tag) |
14 |
| -fi |
15 |
| -visiblever=$ver |
16 |
| -plainver=$ver |
17 |
| - |
18 |
| -# Match 0.0.* as special-case early-access builds |
19 |
| -if [ "${ver%.*}" = 0.0 ]; then |
20 |
| - git tag -d ${ver} |
21 |
| - ver=`git describe --tag HEAD` |
22 |
| - plain_ver=$ver |
| 4 | +if [ ! -z "${manualversion}" ]; then |
| 5 | + |
| 6 | + # manual-made release based on $manualversion |
| 7 | + ver=${manualversion} |
| 8 | + plain_ver=${ver} |
| 9 | + visiblever=${ver} |
| 10 | + [ -z "${REMOTE_URL}" ] && REMOTE_URL=https://github.com/esp8266/Arduino/releases/download |
| 11 | + |
| 12 | +else |
| 13 | + |
| 14 | + # Extract the release name from a release |
| 15 | + |
| 16 | + # Default to draft tag name |
| 17 | + ver=$(basename $(jq -e -r '.ref' "$GITHUB_EVENT_PATH")) |
| 18 | + # If not available, try the publish tag name |
| 19 | + if [ "$ver" == "null" ]; then |
| 20 | + ver=$(jq -e -r '.release.tag_name' "$GITHUB_EVENT_PATH") |
| 21 | + fi |
| 22 | + # Fall back to the git description OTW (i.e. interactive) |
| 23 | + if [ "$ver" == "null" ]; then |
| 24 | + ver=$(git describe --tag) |
| 25 | + fi |
| 26 | + visiblever=$ver |
| 27 | + plainver=$ver |
| 28 | + |
| 29 | + # Match 0.0.* as special-case early-access builds |
| 30 | + if [ "${ver%.*}" = 0.0 ]; then |
| 31 | + git tag -d ${ver} |
| 32 | + ver=`git describe --tag HEAD` |
| 33 | + plain_ver=$ver |
| 34 | + fi |
23 | 35 | fi
|
24 | 36 |
|
25 | 37 | set -e
|
|
0 commit comments