Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README in release ci #518

Merged
merged 10 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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