Skip to content

Commit

Permalink
Improve releasing instructions.
Browse files Browse the repository at this point in the history
  • Loading branch information
nabs-m committed Oct 9, 2024
1 parent 9cba476 commit 02b872d
Showing 1 changed file with 33 additions and 22 deletions.
55 changes: 33 additions & 22 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,48 @@

## Production Releases

---

***Before you begin:*** Please make sure you are set up with
[`bundle exec pod trunk`](https://guides.cocoapods.org/making/getting-setup-with-trunk.html) and your CocoaPods
account is a contributor for all pods. If you need to be added as a
contributor, please [open a ticket requesting access](https://github.com/square/workflow-swift/issues/new).

For Squares, membership is managed through the `Workflow Swift Owners` registry group. Please request access to that group through Registry. Once you have access, you can register a session with `bundle exec pod trunk` using the group e-mail alias `[email protected]`.

`bundle exec pod trunk register [email protected] 'Workflow Swift Owners' --description='Your computer description'`

---

> ⚠️ [Optional] To avoid possible headaches when publishing podspecs, validation can be performed before updating the Workflow version number(s). To do this, run the following in the root directory of this repo:
> ```bash
> bundle exec pod lib lint Workflow.podspec ViewEnvironment.podspec ViewEnvironmentUI.podspec WorkflowTesting.podspec WorkflowReactiveSwift.podspec WorkflowUI.podspec WorkflowRxSwift.podspec WorkflowReactiveSwiftTesting.podspec WorkflowRxSwiftTesting.podspec WorkflowSwiftUIExperimental.podspec WorkflowCombine.podspec WorkflowCombineTesting.podspec WorkflowConcurrency.podspec WorkflowConcurrencyTesting.podspec
> ```
> You may need to `--include-podspecs` for pods that have changed and are depended on by other of the pods.
### Updating the release
1. Update `WORKFLOW_VERSION` in `version.rb` based on [`semver`](https://semver.org/).

1. Create a PR with the version change and merge to `main`.

1. Create the release on GitHub:
1. Go to the [Releases](https://github.com/square/workflow-swift/releases) and `Draft a new release`.
1. `Choose a tag` and create a tag for the new version. ex: `v1.0.0`
1. `Generate release notes`
1. `Choose a tag` and create a tag for the new version. ex: `v1.0.0`.
1. `Generate release notes`.
1. Ensure the `Title` corresponds to the version we're publishing and the generated `Release Notes` are accurate.
1. Hit `Publish release`.

1. Publish to CocoaPods:
At this point, the new release is available and can be consumed using the Swift Package Manager.

[Square specific] To make the new version available internally, [bump the version](https://go/spm-bump-dependency) through SPM.

### Publishing to CocoaPods

1. You need to have 2 older Xcode versions, but you will only use them through the command line, so do not worry about the app being incompatible with your macOS version. You will also need to tweak one of them:
1. Download **Xcode 14.2**. This will be used to publish all pods except for `WorkflowRxSwift` and `WorkflowRxSwiftTesting`.
1. Download **Xcode 15.4**. This will be used to publish `WorkflowRxSwift` and `WorkflowRxSwiftTesting`.
1. Copy `Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc`from within the Xcode 14.2 app to the same location in Xcode 15.4.

1. Make sure you are set up with
[`bundle exec pod trunk`](https://guides.cocoapods.org/making/getting-setup-with-trunk.html) and your CocoaPods
account is a contributor for all pods. If you need to be added as a
contributor, please [open a ticket requesting access](https://github.com/square/workflow-swift/issues/new).
1. For Squares, membership is managed through the `workflow-swift-owners` registry group. Please request access to that group through Registry.
1. Once you have access, you can register a session with `bundle exec pod trunk` using the group e-mail alias `[email protected]`:
`bundle exec pod trunk register [email protected] 'Workflow Swift Owners' --description='Your computer description'`.
1. You should receive an email from CocoaPods to confirm your session before you procede.

1. To avoid possible headaches when publishing podspecs, validation can be performed first.
1. Switch to Xcode 15.4: `sudo xcode-select -s Path/to/Xcode15.4`.
1. Run `bundle exec pod lib lint WorkflowRxSwift.podspec WorkflowRxSwiftTesting.podspec`.
1. Ensure you're on Xcode 14.2: `sudo xcode-select -s Path/to/Xcode14.2`.
1. Run the following:
```bash
bundle exec pod lib lint Workflow.podspec ViewEnvironment.podspec ViewEnvironmentUI.podspec WorkflowTesting.podspec WorkflowReactiveSwift.podspec WorkflowUI.podspec WorkflowReactiveSwiftTesting.podspec WorkflowSwiftUIExperimental.podspec WorkflowCombine.podspec WorkflowCombineTesting.podspec WorkflowConcurrency.podspec WorkflowConcurrencyTesting.podspec
```

1. Once validation passes on all pods, you can publish to CocoaPods:
```bash
bundle exec pod trunk push Workflow.podspec --synchronous
bundle exec pod trunk push WorkflowTesting.podspec --synchronous
Expand Down

0 comments on commit 02b872d

Please sign in to comment.