Skip to content

Commit 74b3241

Browse files
committed
#147 revert back still issue
1 parent c61e99c commit 74b3241

1 file changed

Lines changed: 4 additions & 34 deletions

File tree

.github/workflows/cd-release.yml

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ on:
44
push:
55
tags:
66
- "v[0-9]+.[0-9]+.[0-9]+"
7-
- "v[0-9]+.[0-9]+.[0-9]+-preview*"
87

98
jobs:
109
build:
1110
runs-on: ubuntu-latest
11+
1212
timeout-minutes: 15
1313

1414
steps:
@@ -18,49 +18,19 @@ jobs:
1818
fetch-depth: 0
1919

2020
- name: Verify commit exists in origin/main
21-
run: |
22-
git fetch origin main
23-
if git merge-base --is-ancestor $GITHUB_SHA origin/main; then
24-
echo "✅ Commit exists in main"
25-
else
26-
echo "❌ Commit is not in main"
27-
exit 1
28-
fi
21+
run: git branch --remote --contains | grep origin/main
2922

3023
- name: Extract release notes
3124
run: |
32-
git log --pretty=format:'%d %s' ${GITHUB_REF} | perl -pe 's| \(.*tag: v(\d+.\d+.\d+(-preview[0-9A-Za-z\.\-]+)?)?(, .*?)*\)|\n## \1\n|g' > RELEASE-NOTES
25+
git log --pretty=format:'%d %s' ${GITHUB_REF} | perl -pe 's| \(.*tag: v(\d+.\d+.\d+(-preview\d{3})?)(, .*?)*\)|\n## \1\n|g' > RELEASE-NOTES
3326
3427
- name: Setup .NET
3528
uses: actions/setup-dotnet@v4
3629
with:
3730
dotnet-version: 8.0.x
3831

3932
- name: Set VERSION variable from tag
40-
run: |
41-
RAW_VERSION=${GITHUB_REF/refs\/tags\/v/}
42-
43-
BASE=$(echo $RAW_VERSION | cut -d- -f1)
44-
PRE=$(echo $RAW_VERSION | cut -s -d- -f2-)
45-
46-
if [ -n "$PRE" ]; then
47-
# Split prerelease into parts by dot and strip leading zeros from numbers
48-
CLEAN_PRE=$(echo $PRE | awk -F. '{
49-
out=$1;
50-
for (i=2;i<=NF;i++) {
51-
if ($i ~ /^[0-9]+$/) sub(/^0+/, "", $i);
52-
if ($i == "") $i="0";
53-
out=out"."$i
54-
}
55-
print out
56-
}')
57-
VERSION="$BASE-$CLEAN_PRE"
58-
else
59-
VERSION="$BASE"
60-
fi
61-
62-
echo "Using VERSION=$VERSION"
63-
echo "VERSION=$VERSION" >> $GITHUB_ENV
33+
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
6434

6535
- name: Build
6636
run: dotnet build --configuration Release /p:Version=${VERSION}

0 commit comments

Comments
 (0)