Skip to content

Commit

Permalink
Add instructions to tag versions and update Homebrew
Browse files Browse the repository at this point in the history
  • Loading branch information
msuchane committed Jun 17, 2024
1 parent 7e3a88a commit 7ca18c0
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 3 deletions.
66 changes: 65 additions & 1 deletion PACKAGING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,47 @@

The following are instructions for the maintainers of `newdoc` to package and distribute new releases.


## Preparing a new version

1. Update newdoc dependencies:

```
$ cargo update
```
2. Make your changes to the code and merge them to the `main` branch.
3. Update the version number in `Cargo.toml` and `newdoc.spec`. The versions must be identical.
4. Commit the version update:
```
$ git commit -am "Update the version to X.Y.Z"
```
5. Tag the latest commit with the new version number:
```
$ git tag -a vX.Y.Z -m "Version X.Y.Z"
```
Make sure to prefix the version in the tag name with "v" for "version".
6. Push the version tag to the remote repository:
```
$ git push --follow-tags
```
If you're using several remote repositories, such as origin and upstream, make sure to push the tag to all of them.
## Packaging and distributing newdoc as an RPM package
1. Log into the Copr repository administration: <https://copr.fedorainfracloud.org/coprs/mareksu/newdoc-rs/>.
1. Log into the Copr repository administration.
Currently, newdoc is packaged in the [mareksu/newdoc-rs](https://copr.fedorainfracloud.org/coprs/mareksu/newdoc-rs/) repository.
2. Go to the **Builds** tab.
Expand All @@ -18,6 +56,32 @@ The following are instructions for the maintainers of `newdoc` to package and di
7. Click **Build**.
## Packaging and distributing newdoc with Homebrew
1. Make sure you have access to the existing Homebrew repository.
Currently, newdoc is packaged in [msuchane/homebrew-repo](https://github.com/redhat-documentation/homebrew-repo), but a fork at [redhat-documentation/homebrew-repo](https://github.com/redhat-documentation/homebrew-repo) is also available.
2. Download the `.tar.gz` archive that Github created for your latest tagged version:
<https://github.com/redhat-documentation/newdoc/tags>
3. Calculate the SHA256 checksum of this archive:
```
$ sha256sum vX.Y.Z.tar.gz
```
4. In the `homebrew-repo` repository, edit the `Formula/newdoc.rb` file.
5. In the `url` attribute, update the version in the URL to your latest version.
6. In the `sha256` attribute, replace the existing checksum with the new checksum that you calculated.
7. Commit and push the changes.
## Packaging and distributing newdoc on Crates.io
1. If you are publishing to Crates.io for the first time on this system, log into your account:
Expand Down
4 changes: 2 additions & 2 deletions newdoc.spec
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ License: GPLv3+
URL: https://github.com/redhat-documentation/newdoc
Group: Applications/Text
Obsoletes: python3-newdoc, python2-newdoc
Source0: https://static.crates.io/crates/%{name}/%{name}-%{version}.crate
#Source1: https://github.com/redhat-documentation/%{name}/archive/refs/tags/v%{version}.tar.gz
#Source0: https://static.crates.io/crates/%{name}/%{name}-%{version}.crate
Source0: https://github.com/redhat-documentation/%{name}/archive/refs/tags/v%{version}.tar.gz

# This works fine with Fedora and RHEL, but breaks the SUSE build:
# ExclusiveArch: %{rust_arches}
Expand Down

0 comments on commit 7ca18c0

Please sign in to comment.