Skip to content

Commit 3ebaba4

Browse files
committed
ci: simplify process
1 parent 832b575 commit 3ebaba4

File tree

2 files changed

+13
-30
lines changed

2 files changed

+13
-30
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -137,24 +137,11 @@ jobs:
137137
search_commit_body: true
138138
short_tags: false
139139

140-
- name: Set VERSION (fallback to branch name)
140+
- name: Set VERSION from semantic-version
141141
id: set-version
142142
run: |
143-
# Prefer semantic-version output
144-
if [ -n "${{ steps.semver.outputs.version }}" ]; then
145-
VERSION="${{ steps.semver.outputs.version }}"
146-
echo "Using semantic version: $VERSION"
147-
else
148-
# Fallback: parse from branch name (release/v0.1.0 or release/0.1.0)
149-
BRANCH_NAME="${GITHUB_REF_NAME}"
150-
if [[ "$BRANCH_NAME" =~ ^release/v?([0-9]+\.[0-9]+\.[0-9]+) ]]; then
151-
VERSION="${BASH_REMATCH[1]}"
152-
echo "Using version from branch name: $VERSION"
153-
else
154-
echo "ERROR: Cannot determine version from semver or branch name: $BRANCH_NAME"
155-
exit 1
156-
fi
157-
fi
143+
VERSION="${{ steps.semver.outputs.version }}"
144+
echo "Using semantic version: $VERSION"
158145
echo "VERSION=$VERSION" >> $GITHUB_ENV
159146
echo "version=$VERSION" >> $GITHUB_OUTPUT
160147
@@ -192,19 +179,6 @@ jobs:
192179
echo "$ASSETS" >> $GITHUB_ENV
193180
echo "EOF" >> $GITHUB_ENV
194181
195-
# - name: Create and push tag using Git
196-
# env:
197-
# GH_TOKEN: ${{ secrets.PAT_TOKEN }}
198-
# run: |
199-
# git config user.name "GitHub Action"
200-
# git config user.email "action@github.com"
201-
202-
# # Create annotated tag
203-
# git tag -a "v${{ env.VERSION }}" -m "Release v${{ env.VERSION }}"
204-
205-
# # Push tag using PAT authentication
206-
# git push https://x-access-token:${{ secrets.PAT_TOKEN }}@github.com/${{ github.repository }}.git "v${{ env.VERSION }}"
207-
208182
- name: Create GitHub Release and Upload Assets
209183
uses: softprops/action-gh-release@v2
210184
with:
@@ -272,6 +246,15 @@ jobs:
272246
env:
273247
GH_TOKEN: ${{ secrets.PAT_TOKEN }}
274248
run: |
249+
# Check if there are commits to PR
250+
git fetch origin main
251+
COMMITS_AHEAD=$(git rev-list --count origin/main.."${{ env.BUMP_BRANCH }}")
252+
253+
if [ "$COMMITS_AHEAD" -eq "0" ]; then
254+
echo "No commits to create PR for - branch is up to date with main"
255+
exit 0
256+
fi
257+
275258
# Check if PR already exists
276259
EXISTING_PR=$(gh pr list --head "${{ env.BUMP_BRANCH }}" --base main --json number --jq '.[0].number' 2>/dev/null || echo "")
277260

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "repos"
3-
version = "0.2.0-rc"
3+
version = "0.0.15-rc"
44
edition = "2024"
55

66
[lib]

0 commit comments

Comments
 (0)