Skip to content

Commit

Permalink
chore: update contributing guide (#324)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhayab authored Jul 29, 2024
1 parent 39489b3 commit ba98b92
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 92 deletions.
61 changes: 0 additions & 61 deletions .github/CONTRIBUTING.md

This file was deleted.

44 changes: 23 additions & 21 deletions .github/ISSUE_TEMPLATE/Feature_request.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
---
name: Feature request
about: Suggest an idea for this project

---

<!--
Thanks for participating in this project! We will try to answer as soon as possible 🙏
-->

**Is your feature request related to a problem? Please describe 🙏**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like 🤔**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered ✨**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
---
name: Feature request
about: Suggest an idea for this project
labels:
- feature request

---

<!--
Thanks for participating in this project! We will try to answer as soon as possible 🙏
-->

**Is your feature request related to a problem? Please describe 🙏**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like 🤔**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered ✨**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
2 changes: 1 addition & 1 deletion .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
echo "RELEASE_TYPE=${{ github.event.inputs.release }}" >> $GITHUB_ENV
fi
- name: Check out polyglot
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: algolia/polyglot
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files
fetch-depth: 0
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: SwiftLint
on:
push:
on:
push:
branches: [master]
pull_request:
branches: [master]
Expand All @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files
fetch-depth: 0
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pods.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,32 @@ jobs:
lint-Insights:
runs-on: macos-12
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Select Xcode version
run: sudo xcode-select -s '/Applications/Xcode_14.2.app/Contents/Developer'
- name: lint Insights
run: pod lib lint --subspec="Insights" --allow-warnings
lint-Core:
runs-on: macos-12
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Select Xcode version
run: sudo xcode-select -s '/Applications/Xcode_14.2.app/Contents/Developer'
- name: lint Core
run: pod lib lint --subspec="Core" --allow-warnings
lint-UI:
runs-on: macos-12
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Select Xcode version
run: sudo xcode-select -s '/Applications/Xcode_14.2.app/Contents/Developer'
- name: lint UI
run: pod lib lint --subspec="UI" --allow-warnings
lint-SwiftUI:
runs-on: macos-12
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Select Xcode version
run: sudo xcode-select -s '/Applications/Xcode_14.2.app/Contents/Developer'
- name: lint SwiftUI
run: pod lib lint --subspec="SwiftUI" --allow-warnings
run: pod lib lint --subspec="SwiftUI" --allow-warnings
114 changes: 114 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Contributing to instantsearch-ios

Hello and welcome to this contributing guide. Thanks for considering participating in our project 🙇.

If this guide does not contain what you are looking for and thus prevents you from contributing, don't hesitate to [open an issue](https://github.com/algolia/instantsearch-ios/issues/new/choose).

## Getting help

### Reporting issues

Use [GitHub issues](https://github.com/algolia/instantsearch-ios/issues/new?template=Bug_report.md) to report a bug.

Before creating a new issue:

* Make sure you are using the [latest release](https://github.com/algolia/instantsearch-ios/releases)
* Check if the issue was [already reported or fixed](https://github.com/algolia/instantsearch-ios/issues?q=is%3Aissue). Notice that it may not be released yet

If you found a match add a brief comment "I have the same problem" or "+1". This helps prioritize the issues addressing the most common and critical first. If possible, add additional information to help us reproduce and fix the issue. Please use your best judgement.

When reporting issues, please include the following information to help maintainers to fix the problem faster:
* Xcode version you are using
* iOS version you are targeting
* Full Xcode console output of stack trace or code compilation error
* Any other additional detail you think it would be useful to understand and solve the problem

### Suggesting a feature

We would love to hear your ideas and make a discussion about it. You can use [GitHub issues](https://github.com/algolia/instantsearch-ios/issues/new?template=Feature_request.md) to make feature proposals.

Before submitting your proposal, make sure there is [no similar feature request](https://github.com/algolia/instantsearch-ios/labels/feature%20request). If you found a match feel free to join the discussion or just add a brief "+1" if you think the feature is worth implementing.

Be as specific as possible providing a precise explanation of feature request so anyone can understand the problem and the benefits of solving it.

## Contributing code

### Setup

To set up this project, you will need to install [Xcode](https://developer.apple.com/xcode/) and [Ruby](https://www.ruby-lang.org/en/documentation/installation/).

### Code contribution process

For any code contribution, you need to:

- Fork and clone the project
- Create a new branch for what you want to solve (fix/_issue-number_, feat/_name-of-the-feature_)
- Make your changes
- Open a pull request

Then:

- Peer review of the pull request (by at least one core contributor)
- Automatic checks
- When everything is green, your contribution is merged 🚀

### Commit conventions

This project follows the [conventional changelog](https://conventionalcommits.org/) approach. This means that all commit messages should be formatted using the following scheme:

```
type(scope): description
```

In most cases, we use the following types:

- `fix`: for any resolution of an issue (identified or not)
- `feat`: for any new feature
- `refactor`: for any code change that neither adds a feature nor fixes an issue
- `chore`: for any change that has no impact on the published packages

Finally, if your work is based on an issue on GitHub, please add in the body of the commit message "fix #1234" if it solves the issue #1234 (read "[Closing issues using keywords](https://help.github.com/en/articles/closing-issues-using-keywords)").

Some examples of valid commit messages (used as first lines):

> - feat(helper): implement method X
> - chore(deps): update dependency Y to v1.2.3
> - fix(insights): ensure proeprty Z is valid
### Publishing

All packages in this project are available through the following package managers:

- [Swift Package Manager](https://www.swift.org/documentation/package-manager/)
- [Carthage](https://github.com/Carthage/Carthage)
- [CocoaPods](https://cocoapods.org/pods/InstantSearch)

To publish a new version, trigger a new deployment [from GitHub Actions](https://github.com/algolia/instantsearch-ios/actions/workflows/deployment.yml). It will require specifying the type of release (patch / minor / major) before launching the workflow. It will then prepare the packages by:

- updating version numbers in relevant locations
- updating CHANGELOG.md
- creating git tags and drafting a GitHub release

These changes will be then pushed in a pull request, ready to be merged.

#### CocoaPods specifics

While both Swift Package Manager and Carthage rely on GitHub and git tags to retrieve the library, CocoaPods has its own repository. If for any reason the deployment fails at the `pod_push` step, InstantSearch iOS can be published to CocoaPods manually from an authorized user.

**Registering a user** with CocoaPods:

```sh
pod trunk register [email protected] 'Username'
```

**Authorizing a user** from an already authorized account:

```sh
pod trunk add-owner InstantSearch [email protected]
```

**Publishing a new version** manually:

```sh
pod trunk push --allow-warnings
```

0 comments on commit ba98b92

Please sign in to comment.