Simplify installation and publishing instructions in README

This commit is contained in:
hitchhiker 2025-04-16 22:17:57 +02:00
parent d362d1cabf
commit 3c448dd06f

View File

@ -58,35 +58,30 @@ pnpm build
### In Another Project ### In Another Project
Add the package to your project: #### Option 1: Install from the Gitea Registry (Recommended)
```bash ```bash
# If you're a Generation One team member using the private Gitea registry: # Configure the Gitea registry in your project
# Configure the Gitea registry
echo "@g1:registry=https://git.generation.one/api/packages/GenerationOne/npm/" > .npmrc 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 # Install the package
pnpm add @g1/sse-client pnpm add @g1/sse-client
```
# Alternatively, you can install directly from the public repository: #### Option 2: Create and Install a Tarball
pnpm add git+https://git.generation.one/GenerationOne/g1-ts-common-packages.git
# Or clone the repository and link it locally: ```bash
git clone https://git.generation.one/GenerationOne/g1-ts-common-packages.git # Clone the repository
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:
git clone https://git.generation.one/GenerationOne/g1-ts-common-packages.git git clone https://git.generation.one/GenerationOne/g1-ts-common-packages.git
cd g1-ts-common-packages/packages/sse-client cd g1-ts-common-packages/packages/sse-client
# Build and pack
pnpm install pnpm install
pnpm build pnpm build
pnpm pack # Creates a tarball like g1-sse-client-0.2.0.tgz 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 pnpm add /path/to/g1-sse-client-0.2.0.tgz
``` ```
@ -156,43 +151,34 @@ pnpm -r test
## Publishing Packages ## Publishing Packages
### Prerequisites ### For Team Members
- Gitea access token with `packages:write` permission If you're a team member with write access to the repository:
- 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:
```bash ```bash
# Set your Gitea token # Set your access token
export GITEA_TOKEN="your-token-here" 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 ./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 ## 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, set up the following secrets in your GitHub repository:
- `GITEA_TOKEN`: Your access token
To use the workflows, you need to set up the following secrets in your GitHub repository: - `GITEA_DEPLOY_KEY`: SSH deploy key
- `GITEA_TOKEN`: Your Gitea access token
- `GITEA_DEPLOY_KEY`: SSH deploy key for the repository
## Contributing ## Contributing