From 1c36b9867f08b350b28d25ee4b58321dcb75c3db Mon Sep 17 00:00:00 2001 From: Benjamin Guibert Date: Mon, 1 Apr 2024 23:11:55 +0200 Subject: [PATCH] docs(main): update README and CONTRIBUTING --- .github/CONTRIBUTING.md | 34 ++++++++ .github/ISSUE_TEMPLATE/bug-report.yml | 2 + README.md | 111 ++++++++++++++++---------- 3 files changed, 105 insertions(+), 42 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 7a28684..9e10a2b 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -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). diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index b0e25a3..30c4c4a 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -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: diff --git a/README.md b/README.md index 5f287ad..ea3c794 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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: @@ -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 @@ -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