Skip to content

Commit

Permalink
Update README in release ci (#518)
Browse files Browse the repository at this point in the history
  • Loading branch information
GLinnik21 committed Jun 26, 2024
1 parent 989497e commit 018e6f1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,23 @@ jobs:
sed -i '' 's/const double KSCrashFrameworkVersionNumber = [^;]*/const double KSCrashFrameworkVersionNumber = '"$formatted_version_number"'/' Sources/KSCrashRecording/KSCrash.m
sed -i '' 's/const unsigned char KSCrashFrameworkVersionString\[\] = "[^"]*"/const unsigned char KSCrashFrameworkVersionString[] = "${{ github.event.inputs.version }}"/' Sources/KSCrashRecording/KSCrash.m
- name: Update README
run: |
# Update SPM version
sed -i '' "s/\.package(url: \"https:\/\/github.com\/kstenerud\/KSCrash.git\", .upToNextMajor(from: \"[^\"]*\"))/\.package(url: \"https:\/\/github.com\/kstenerud\/KSCrash.git\", .upToNextMajor(from: \"${{ github.event.inputs.version }}\"))/" README.md
# Update CocoaPods version
VERSION="${{ github.event.inputs.version }}"
if [[ "$VERSION" == *"-"* ]]; then
# It's a pre-release version, use the full version
sed -i '' "s/pod 'KSCrash'.*$/pod 'KSCrash', '~> $VERSION'/" README.md
else
# It's a release version, use major.minor
sed -i '' "s/pod 'KSCrash'.*$/pod 'KSCrash', '~> ${VERSION%.*}'/" README.md
fi
echo "README.md updated with version ${{ github.event.inputs.version }}"
- name: Commit version update
id: commit_version
run: |
Expand Down Expand Up @@ -94,8 +111,8 @@ jobs:
- name: Pull latest changes
run: |
echo "Pulling latest changes from release-action branch..."
git pull origin release-action
echo "Pulling latest changes for the current branch..."
git pull origin "$(git branch --show-current)"
echo "Latest changes pulled successfully."
- name: Revert version commit
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Add the following to your `Package.swift` file:

```swift
dependencies: [
.package(url: "https://github.com/kstenerud/KSCrash.git", from: "2.0.0-alpha.2")
.package(url: "https://github.com/kstenerud/KSCrash.git", .upToNextMajor(from: "2.0.0-alpha.3"))
]
```

Expand All @@ -94,7 +94,7 @@ targets: [

1. Add to your `Podfile`:
```ruby
pod 'KSCrash'
pod 'KSCrash', '~> 2.0.0-alpha.3'
```

2. Run:
Expand Down

0 comments on commit 018e6f1

Please sign in to comment.