Skip to content

Commit

Permalink
docs(main): update README and CONTRIBUTING
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-guibert committed Apr 1, 2024
1 parent 034c8c9 commit 1c36b98
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 42 deletions.
34 changes: 34 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,37 @@ However, **we are not currently accepting new contributions**.

Check out the contributing section of the [`README`](https://github.com/cyberspace7/release-action#contributing)
file to find out how else you can contribute to this project.

## Development

See [`package.json`](package.json) for the list of available scripts.

### Prerequisites

This project require the following dependencies:

- [Node.js](https://nodejs.org)
- [pnpm](https://pnpm.io)

### Setup

Install the dependencies:

```bash
pnpm install
```

### Build

[Source files](src) are are compiled into a single file with all dependencies, into [`dist`](dist).
The `dist` directory must be commited into the repository.

```bash
pnpm build
```

### Release

Releases are automatic, following the merge of the release pull request (see [Release Action](https://github.com/cyberspace7/release-action#readme)).
A release PR can be explicitely generated by running manually
[this workflow](https://github.com/cyberspace7/release-action/actions/workflows/release.yml).
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ body:
attributes:
value: |
Thank you for taking the time to fill out this bug report, your help is much appreciated!
If you're not sure that this is a bug, please ask us in the [Discussions](https://github.com/cyberspace7/release-action/discussions/categories/q-a) first.
- type: textarea
id: description
attributes:
Expand Down
111 changes: 69 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ PR-based Github Action for releasing Node.js projects.
[here](https://github.com/cyberspace7/release-action/milestones), don't hesitate to upvote
issues you want to be treated.
If you have any question, remark, suggestion, ... They are most welcome in the
[discussions](https://github.com/cyberspace7/release-action/discussions)!
[Discussions](https://github.com/cyberspace7/release-action/discussions)!

## Description

Expand Down Expand Up @@ -196,18 +196,19 @@ permissions:

### Inputs

| Name | Description | Default Value |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------- | ------------------- |
| `release-as` | Force a specific version. | |
| `pre-release` | Name of the pre-release version (`alpha`, `beta`, `rc`...). If not empty, will trigger a pre-release. | |
| `labels-ignore`\* | Labels for pull requests to be ignored for the release bump. It should be added to changelog excluded labels (see #usage). | `ignore` |
| `labels-patch`\* | Labels for pull requests to bump a patch version. | `patch`, `fix` |
| `labels-minor`\* | Labels for pull requests to bump a minor version. | `minor`, `feature` |
| `labels-major`\* | Labels for pull requests to bump a major version. | `major`, `breaking` |
| `label-ready` | Label automatically used by Release Action for release PRs. | `release: ready` |
| `label-done` | Label automatically used by Release Action for release PRs that have been processed (current version released). | `release: done` |
| `branch-production` | Branch used for production, the base for all PRs going to production. | `main` |
| `branch-release` | Branch used for release PRs. | `releases/next` |
| Name | Description | Default Value |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- |
| `release-as` | Force a specific version. | |
| `pre-release` | Name of the pre-release version (`alpha`, `beta`, `rc`...). If not empty, will trigger a pre-release. | |
| `labels-ignore`\* | Labels for pull requests to be ignored for the release bump. It should be added to changelog excluded labels (see #usage). | `ignore` |
| `labels-patch`\* | Labels for pull requests to bump a patch version. | `patch`, `fix` |
| `labels-minor`\* | Labels for pull requests to bump a minor version. | `minor`, `feature` |
| `labels-major`\* | Labels for pull requests to bump a major version. | `major`, `breaking` |
| `label-ready` | Label automatically used by Release Action for release PRs. | `release: ready` |
| `label-done` | Label automatically used by Release Action for release PRs that have been processed (current version released). | `release: done` |
| `branch-production` | Branch used for production, the base for all PRs going to production. | `main` |
| `branch-release` | Branch used for release PRs. | `releases/next` |
| `skip-pr-creation` | Skip release PR creation. When there are changes, if the PR exists, it will still be updated. if the PR doesn't exist but the release branch does, the later will still be updated as well. | `false` |

\*Multiple labels can be defined using a multiline block such as follow:

Expand Down Expand Up @@ -237,43 +238,65 @@ _None._
| -------------- | ------------------------------------------- |
| `GITHUB_TOKEN` | Authentification token used for GitHub API. |

## Development
### Examples

See [`package.json`](package.json) for the list of available scripts.
Execute another job when a release has been made:

### Prerequisites

This project require the following dependencies:

- [Node.js](https://nodejs.org)
- [pnpm](https://pnpm.io)

### Setup

Install the dependencies:

```bash
pnpm install
```

### Build
```yaml
name: Release
[Source files](src) are are compiled into a single file with all dependencies, into [`dist`](dist).
The `dist` directory must be commited into the repository.
on:
push:
branches:
- main
```bash
pnpm build
jobs:
release:
name: Release
runs-on: ubuntu-latest
outputs:
is-released: ${{ steps.action.outputs.is-released }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Execute action
id: action
uses: cyberspace7/release-action@v0.6.0
publish:
name: Publish
needs: release
if: needs.release.outputs.is-released == 'true'
uses: ./.github/workflows/publish.yml
```

### Release
Run the action on main branch update, skip the release PR creation unless triggered manually:

Releases are automatic, following the merge of the release pull request (see [Release Action](https://github.com/cyberspace7/release-action#readme)).
A release PR can be explicitely generated by running manually
[this workflow](https://github.com/cyberspace7/release-action/actions/workflows/release.yml).
```yaml
name: Release
## Authors
on:
push:
branches:
- main
workflow_dispatch:
- [**Benjamin Guibert**](https://github.com/benjamin-guibert) – main author and contributor.
jobs:
release:
name: Release
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Execute action
id: action
uses: cyberspace7/release-action@v0.6.0
with:
skip-pr-creation: ${{ github.event_name == 'workflow_dispatch' }}
```

## Contributing

Expand All @@ -283,7 +306,11 @@ in the [discussions](https://github.com/cyberspace7/release-action/discussions/c
If you find a bug concerning this project, please fill a [bug report](https://github.com/cyberspace7/release-action/issues/new?assignees=&labels=bug-report&projects=&template=bug-report.yml).
If it concerns a security vulnerability, please email us at `contact@a60.dev`.

For contributing, please check the [guidelines](.github/CONTRIBUTING.md).
For contributing, please check the [Contributing Guidelines](.github/CONTRIBUTING.md).

## Authors

- [**Benjamin Guibert**](https://github.com/benjamin-guibert) – main author and contributor.

## Licensing

Expand Down

0 comments on commit 1c36b98

Please sign in to comment.