Skip to content

Commit ee01884

Browse files
committed
WIP
1 parent 10b5bcd commit ee01884

File tree

1 file changed

+35
-4
lines changed

1 file changed

+35
-4
lines changed

.github/workflows/release.yml

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ jobs:
3636
echo "version=$VERSION" >> $GITHUB_OUTPUT
3737
echo "Extracted version: $VERSION"
3838
39+
- name: Check current version
40+
id: current_version
41+
run: |
42+
CURRENT_VERSION=$(ruby -e "require_relative 'lib/session_recorder/version'; puts Multiplayer::SessionRecorder::VERSION")
43+
echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
44+
echo "Current version in file: $CURRENT_VERSION"
45+
echo "Tag version: ${{ steps.version.outputs.version }}"
46+
3947
- name: Update version file
4048
run: |
4149
# Update the version in lib/session_recorder/version.rb
@@ -54,9 +62,16 @@ jobs:
5462
run: |
5563
git config --local user.email "[email protected]"
5664
git config --local user.name "GitHub Action"
57-
git add lib/session_recorder/version.rb
58-
git commit -m "chore: bump version to ${{ steps.version.outputs.version }}"
59-
git push origin main
65+
66+
# Check if there are changes to commit
67+
if git diff --quiet; then
68+
echo "No changes to commit - version already up to date"
69+
else
70+
git add lib/session_recorder/version.rb
71+
git commit -m "chore: bump version to ${{ steps.version.outputs.version }}"
72+
git push origin main
73+
echo "Version updated and pushed successfully"
74+
fi
6075
6176
- name: Configure Bundler
6277
run: |
@@ -101,11 +116,27 @@ jobs:
101116
fi
102117
fi
103118
119+
- name: Configure RubyGems credentials
120+
run: |
121+
# Create .gemrc file with API key
122+
cat > ~/.gemrc << EOF
123+
---
124+
:rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}
125+
EOF
126+
echo "RubyGems credentials configured"
127+
104128
- name: Publish to RubyGems
105129
env:
106130
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
107131
run: |
108-
gem push "${{ steps.gem_file.outputs.gem_path }}"
132+
# Verify API key is set
133+
if [ -z "$RUBYGEMS_API_KEY" ]; then
134+
echo "Error: RUBYGEMS_API_KEY is not set"
135+
exit 1
136+
fi
137+
138+
echo "Publishing gem: ${{ steps.gem_file.outputs.gem_path }}"
139+
gem push "${{ steps.gem_file.outputs.gem_path }}" --key "$RUBYGEMS_API_KEY"
109140
110141
- name: Create GitHub Release
111142
uses: actions/create-release@v1

0 commit comments

Comments
 (0)