Simplify installation and publishing instructions in README
This commit is contained in:
parent
d362d1cabf
commit
3c448dd06f
68
README.md
68
README.md
@ -58,35 +58,30 @@ pnpm build
|
||||
|
||||
### In Another Project
|
||||
|
||||
Add the package to your project:
|
||||
#### Option 1: Install from the Gitea Registry (Recommended)
|
||||
|
||||
```bash
|
||||
# If you're a Generation One team member using the private Gitea registry:
|
||||
# Configure the Gitea registry
|
||||
# Configure the Gitea registry in your project
|
||||
echo "@g1:registry=https://git.generation.one/api/packages/GenerationOne/npm/" > .npmrc
|
||||
echo "//git.generation.one/api/packages/GenerationOne/npm/:_authToken=${GITEA_TOKEN}" >> .npmrc
|
||||
|
||||
# Install the package
|
||||
pnpm add @g1/sse-client
|
||||
```
|
||||
|
||||
# Alternatively, you can install directly from the public repository:
|
||||
pnpm add git+https://git.generation.one/GenerationOne/g1-ts-common-packages.git
|
||||
#### Option 2: Create and Install a Tarball
|
||||
|
||||
# Or clone the repository and link it locally:
|
||||
git clone https://git.generation.one/GenerationOne/g1-ts-common-packages.git
|
||||
cd g1-ts-common-packages
|
||||
pnpm install
|
||||
pnpm build
|
||||
cd packages/sse-client
|
||||
pnpm link .
|
||||
|
||||
# Another option is to create a tarball and install it directly:
|
||||
```bash
|
||||
# Clone the repository
|
||||
git clone https://git.generation.one/GenerationOne/g1-ts-common-packages.git
|
||||
cd g1-ts-common-packages/packages/sse-client
|
||||
|
||||
# Build and pack
|
||||
pnpm install
|
||||
pnpm build
|
||||
pnpm pack # Creates a tarball like g1-sse-client-0.2.0.tgz
|
||||
# Then in your project:
|
||||
|
||||
# Install the tarball in your project
|
||||
cd /path/to/your/project
|
||||
pnpm add /path/to/g1-sse-client-0.2.0.tgz
|
||||
```
|
||||
|
||||
@ -156,43 +151,34 @@ pnpm -r test
|
||||
|
||||
## Publishing Packages
|
||||
|
||||
### Prerequisites
|
||||
### For Team Members
|
||||
|
||||
- Gitea access token with `packages:write` permission
|
||||
- Write access to the Generation One Gitea repository
|
||||
|
||||
> **Note:** While the repository is public and anyone can clone it, publishing packages to the Gitea registry requires proper authentication and authorization.
|
||||
|
||||
### Publishing a Package
|
||||
|
||||
Use the provided script:
|
||||
If you're a team member with write access to the repository:
|
||||
|
||||
```bash
|
||||
# Set your Gitea token
|
||||
# Set your access token
|
||||
export GITEA_TOKEN="your-token-here"
|
||||
# Or create a .gitea-token file in the root directory
|
||||
|
||||
# Publish with a patch version bump
|
||||
# Publish with a version bump
|
||||
./scripts/publish-package.sh packages/sse-client patch
|
||||
|
||||
# Publish with a specific version
|
||||
./scripts/publish-package.sh packages/sse-client version:0.3.0
|
||||
|
||||
# Publish without changing the version
|
||||
./scripts/publish-package.sh packages/sse-client none
|
||||
```
|
||||
|
||||
For more detailed publishing instructions, see [docs/DEPLOY_KEYS.md](docs/DEPLOY_KEYS.md).
|
||||
Version options:
|
||||
- `patch` - Increment the patch version (0.2.0 → 0.2.1)
|
||||
- `minor` - Increment the minor version (0.2.0 → 0.3.0)
|
||||
- `major` - Increment the major version (0.2.0 → 1.0.0)
|
||||
- `version:x.y.z` - Set a specific version
|
||||
- `none` - Keep the current version
|
||||
|
||||
For detailed instructions, see [docs/DEPLOY_KEYS.md](docs/DEPLOY_KEYS.md).
|
||||
|
||||
## CI/CD
|
||||
|
||||
This repository includes GitHub Actions workflows for automated testing and publishing:
|
||||
This repository includes GitHub Actions workflows for automated testing and publishing.
|
||||
|
||||
- **Publish Package**: Publishes a package to the Gitea registry
|
||||
|
||||
To use the workflows, you need to set up the following secrets in your GitHub repository:
|
||||
- `GITEA_TOKEN`: Your Gitea access token
|
||||
- `GITEA_DEPLOY_KEY`: SSH deploy key for the repository
|
||||
To use the workflows, set up the following secrets in your GitHub repository:
|
||||
- `GITEA_TOKEN`: Your access token
|
||||
- `GITEA_DEPLOY_KEY`: SSH deploy key
|
||||
|
||||
## Contributing
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user