|
1 | | -# Release please reusable workflows |
| 1 | +# 🚀 Release Please Reusable Workflows |
2 | 2 |
|
3 | | -This is the reusable workflow for release any project. |
| 3 | +This documentation explains how to configure and use the reusable **release-please** workflow in your projects. For further details on **release-please**, please refer to the [release-please GitHub page](https://github.com/googleapis/release-please). |
4 | 4 |
|
5 | | -## Secrets |
| 5 | +## 1. Configuration Files |
6 | 6 |
|
7 | | -### application_id |
| 7 | +### 1.1. release-please-config.json |
8 | 8 |
|
9 | | -**Required** The application id to use to log app in to GitHub. |
| 9 | +This file, placed at the root of your project, defines the schema, customizes the changelog sections, and sets the release type rules for your package(s). For example, in a Node.js project: |
10 | 10 |
|
11 | | -### private_key |
| 11 | +```json |
| 12 | +{ |
| 13 | + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", |
| 14 | + "changelog-sections": [ |
| 15 | + { "type": "feat", "section": "🚀 Features", "hidden": false }, |
| 16 | + { "type": "change", "section": "🚀 Features", "hidden": false }, |
| 17 | + { "type": "deprecate", "section": "⚠️ Changes", "hidden": false }, |
| 18 | + { "type": "remove", "section": "⚠️ Changes", "hidden": false }, |
| 19 | + { "type": "fix", "section": "🐞 Bug Fixes", "hidden": false }, |
| 20 | + { "type": "revert", "section": "🐞 Bug Fixes", "hidden": false }, |
| 21 | + { "type": "security", "section": "🐞 Bug Fixes", "hidden": false }, |
| 22 | + { "type": "perf", "section": "✨ Polish", "hidden": false }, |
| 23 | + { "type": "refactor", "section": "✨ Polish", "hidden": false }, |
| 24 | + { "type": "style", "section": "✨ Polish", "hidden": false }, |
| 25 | + { "type": "build", "section": "🧰 Other", "hidden": false }, |
| 26 | + { "type": "chore", "section": "🧰 Other", "hidden": false }, |
| 27 | + { "type": "deps", "section": "🧰 Other", "hidden": true }, |
| 28 | + { "type": "ci", "section": "🧰 Other", "hidden": true }, |
| 29 | + { "type": "test", "section": "🧪 Tests", "hidden": false }, |
| 30 | + { "type": "docs", "section": "📚 Documentation", "hidden": true } |
| 31 | + ], |
| 32 | + "packages": { |
| 33 | + ".": { |
| 34 | + "release-type": "node", |
| 35 | + "changelog-path": "CHANGELOG.md" |
| 36 | + } |
| 37 | + } |
| 38 | +} |
| 39 | +``` |
12 | 40 |
|
13 | | -**Required** The private key to use to log app in to GitHub. |
| 41 | +### 1.2. .release-please-manifest.json |
14 | 42 |
|
| 43 | +This file tracks the published versions by **release-please**. You can start with it empty if your project has no version yet, or pre-fill it with versions if necessary. |
15 | 44 |
|
16 | | -## Example usage |
| 45 | +*Empty initialization:* |
| 46 | + |
| 47 | +```json |
| 48 | +{} |
| 49 | +``` |
| 50 | + |
| 51 | +*Or with predefined versions:* |
| 52 | + |
| 53 | +```json |
| 54 | +{ |
| 55 | + "packages": { |
| 56 | + ".": { |
| 57 | + "version": "1.0.0" |
| 58 | + } |
| 59 | + } |
| 60 | +} |
| 61 | +``` |
| 62 | + |
| 63 | +## 2. ⚙️ Usage in Your Repository |
| 64 | + |
| 65 | +Place the following YAML file (e.g., `.github/workflows/release.yml`) in your repository to directly call the reusable workflow. It triggers the workflow on a push to the `main` branch, applies the necessary permissions, and inherits secrets. |
17 | 66 |
|
18 | 67 | ```yaml |
19 | | -uses: iExecBlockchainComputing/github-actions-workflows/[email protected] |
20 | | -secrets: |
21 | | - application_id: ${{ secrets.application_id }} |
22 | | - private_key: ${{ secrets.private_key }} |
23 | | -``` |
| 68 | +on: |
| 69 | + push: |
| 70 | + branches: |
| 71 | + - main |
| 72 | + |
| 73 | +permissions: |
| 74 | + contents: write |
| 75 | + issues: write |
| 76 | + pull-requests: write |
| 77 | + |
| 78 | +name: release-please |
| 79 | + |
| 80 | +jobs: |
| 81 | + release-please: |
| 82 | + uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/[email protected] |
| 83 | + secrets: inherit |
| 84 | +``` |
| 85 | +
|
| 86 | +## 3. Release Types |
| 87 | +
|
| 88 | +**release-please** supports different release types tailored for various ecosystems and languages via the `release-type` parameter in the configuration file. Here are some of the common ones: |
| 89 | + |
| 90 | +- **node** |
| 91 | + For Node.js projects, it automatically manages changelogs and bump versions following semver conventions. |
| 92 | + |
| 93 | +- **java** |
| 94 | + For Java projects, applying specific rules for Maven, Gradle, and other build tools. |
| 95 | + |
| 96 | +- **python** |
| 97 | + For Python projects, it follows versioning conventions commonly used in the Python ecosystem. |
| 98 | + |
| 99 | +- **ruby**, **go**, **dotnet** |
| 100 | + Additional types are available based on the nature of your project. |
| 101 | + |
| 102 | +> For more detailed information on each release type and additional configuration options, please visit the [release-please documentation](https://github.com/googleapis/release-please). |
| 103 | + |
| 104 | +## 4. Use Cases: Single Project vs. Monorepo |
| 105 | + |
| 106 | +### 4.1. Single Project |
| 107 | + |
| 108 | +For a single project, the entire configuration and version tracking are managed for one package: |
| 109 | + |
| 110 | +- **Configuration:** |
| 111 | + The `release-please-config.json` file contains the global settings, and the `.release-please-manifest.json` file tracks the unique version. |
| 112 | + |
| 113 | +- **Workflow:** |
| 114 | + The YAML file located in `.github/workflows/release.yml` triggers the release process for the entire project. |
| 115 | + |
| 116 | +### 4.2. Monorepo (Multiple Projects) |
| 117 | + |
| 118 | +For a monorepo containing several projects, the configuration allows you to manage each package independently: |
| 119 | + |
| 120 | +- **Configuration:** |
| 121 | + In the `release-please-config.json` file, you can define multiple packages under the `"packages"` key. For example, if your monorepo contains a primary package and a subproject named `subproject`: |
| 122 | + |
| 123 | + ```json |
| 124 | + { |
| 125 | + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", |
| 126 | + "changelog-sections": [ |
| 127 | + { "type": "feat", "section": "🚀 Features", "hidden": false }, |
| 128 | + { "type": "fix", "section": "🐞 Bug Fixes", "hidden": false }, |
| 129 | + { "type": "docs", "section": "📚 Documentation", "hidden": true }, |
| 130 | + ... |
| 131 | + ], |
| 132 | + "packages": { |
| 133 | + ".": { |
| 134 | + "release-type": "node", |
| 135 | + "changelog-path": "CHANGELOG.md" |
| 136 | + }, |
| 137 | + "subproject": { |
| 138 | + "release-type": "node", |
| 139 | + "changelog-path": "subproject/CHANGELOG.md" |
| 140 | + } |
| 141 | + } |
| 142 | + } |
| 143 | + ``` |
| 144 | + |
| 145 | +- **Manifest:** |
| 146 | + The `.release-please-manifest.json` file can maintain separate entries for each package: |
| 147 | + |
| 148 | + ```json |
| 149 | + { |
| 150 | + "packages": { |
| 151 | + ".": { |
| 152 | + "version": "1.0.0" |
| 153 | + }, |
| 154 | + "subproject": { |
| 155 | + "version": "0.9.0" |
| 156 | + } |
| 157 | + } |
| 158 | + } |
| 159 | + ``` |
| 160 | + |
| 161 | +- **Workflow:** |
| 162 | + The YAML workflow file remains the same, triggering the release process for all defined packages according to the configuration. |
| 163 | + |
| 164 | +This documentation helps you automate and centralize your release process effectively, leveraging the flexibility provided by **release-please**. Feel free to adapt these examples to your specific requirements and consult the [official documentation](https://github.com/googleapis/release-please) for more options and details! |
0 commit comments