From 3dacef8afd1e7413830277b371c97f0d9e70c122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sun, 15 Sep 2024 21:01:49 +0200 Subject: [PATCH] docs: gitlab --- docs/SUMMARY.md | 4 +- docs/reference/gitlab-cicd-component.md | 1 + docs/tutorials/github.md | 4 +- docs/tutorials/gitlab.md | 74 +++++++++++++++++++++++++ 4 files changed, 79 insertions(+), 4 deletions(-) create mode 100644 docs/reference/gitlab-cicd-component.md create mode 100644 docs/tutorials/gitlab.md diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 978f0d5..146f9f7 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -5,7 +5,7 @@ # Tutorials - [Getting started on GitHub](tutorials/github.md) -- [Getting started on GitLab]() +- [Getting started on GitLab](tutorials/gitlab.md) # Explanation @@ -23,7 +23,7 @@ - [Glossary](reference/glossary.md) - [Pull Request Options](reference/pr-options.md) - [GitHub Action](reference/github-action.md) -- [GitLab CI]() +- [GitLab CI/CD Component](reference/gitlab-cicd-component.md) --- diff --git a/docs/reference/gitlab-cicd-component.md b/docs/reference/gitlab-cicd-component.md new file mode 100644 index 0000000..7d8bf16 --- /dev/null +++ b/docs/reference/gitlab-cicd-component.md @@ -0,0 +1 @@ +# GitLab CI/CD Component diff --git a/docs/tutorials/github.md b/docs/tutorials/github.md index 83f797c..3677e65 100644 --- a/docs/tutorials/github.md +++ b/docs/tutorials/github.md @@ -1,6 +1,6 @@ -# GitHub +# Getting started on GitHub -In this tutorial we show how to install `releaser-pleaser` in your GitHub project. +In this tutorial you will learn how to set up `releaser-pleaser` in your GitHub project with GitHub Actions. ## 1. Repository Settings diff --git a/docs/tutorials/gitlab.md b/docs/tutorials/gitlab.md new file mode 100644 index 0000000..3c52c8d --- /dev/null +++ b/docs/tutorials/gitlab.md @@ -0,0 +1,74 @@ +# Getting started on GitLab + +In this tutorial you will learn how to set up `releaser-pleaser` in your GitLab repository with GitLab CI. + +## 1. Repository Settings + +### 1.1. Fast-forward merge method + + + +### 1.1. Squashing + +`releaser-pleaser` requires you to use `squash` merging. With other merge options it can not reliably find the right pull request for every commit on `main`. + +Open your repository settings to page _General_: + +> `https://github.com/YOUR-NAME/YOUR-PROJECT/settings` + +In the "Pull Requests" section make sure that only "Allow squash merging" is enabled and "Allow merge commits" and "Allow rebase merging" is disabled. + +![Screenshot of the required merge settings](./github-settings-pr.png) + +### 1.2. Workflow Permissions + +`releaser-pleaser` creates [release pull requests](../explanation/release-pr.md) for you. By default, Actions are not allowed to create pull requests, so we need to enable this. + +Open your repository settings to page _Actions > General_: + +> `https://github.com/YOUR-NAME/YOUR-PROJECT/settings/actions` + +In the "Workflow permissions" section make sure that "Allow GitHub Actions to create and approve pull requests" is enabled. + +![Screenshot of the required workflow settings](./github-settings-workflow.png) + +## 2. GitHub Actions Workflow + +Create a new file `.github/workflows/releaser-pleaser.yaml` with this content. Make sure that it is available on the `main` branch. + +```yaml +name: releaser-pleaser + +on: + push: + branches: [main] + pull_request_target: + types: + - edited + - labeled + - unlabeled + +jobs: + releaser-pleaser: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - name: releaser-pleaser + uses: apricote/releaser-pleaser@v0.2.0 +``` + +## 3. Release Pull Request + +Once this job runs for the first time, you can check the logs to see what it did. +If you have releasable commits since the last tag, `releaser-pleaser` opens a release pull request for the proposed release. + +Once you merge this pull request, `releaser-pleaser` automatically creates a Git tag and GitHub Release with the proposed version and changelog. + +## Related Documentation + +- **Explanation** + - [Release Pull Request](../explanation/release-pr.md) +- **Reference** + - [GitHub CI/CD Component](../reference/gitlab-cicd-component.md)