diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 24a8e87..0000000 --- a/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.png filter=lfs diff=lfs merge=lfs -text diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 908f3ad..b61d5c9 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -14,7 +14,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - lfs: "true" + fetch-depth: 0 - name: Install latest mdbook run: | tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name') diff --git a/CHANGELOG.md b/CHANGELOG.md index e26396b..f3e7084 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,5 @@ # Changelog -## [v0.2.0](https://github.com/apricote/releaser-pleaser/releases/tag/v0.2.0) -### Features - -- update version references in any files (#14) -- **cli**: add --version flag (#29) - -### Bug Fixes - -- **ci**: building release image fails (#21) -- **ci**: ko pipeline permissions (#23) -- **action**: invalid quoting for extra-files arg (#25) - ## [v0.2.0-beta.2](https://github.com/apricote/releaser-pleaser/releases/tag/v0.2.0-beta.2) ### Features diff --git a/action.yml b/action.yml index 0a488b2..2033394 100644 --- a/action.yml +++ b/action.yml @@ -5,23 +5,21 @@ branding: icon: 'package' color: 'red' inputs: - # Remember to update docs/reference/github-action.md branch: default: main description: "This branch is used as the target for releases." token: - description: 'GitHub token for creating and updating release PRs, defaults to using secrets.GITHUB_TOKEN' + description: 'GitHub token for creating and grooming release PRs, defaults to using secrets.GITHUB_TOKEN' required: false default: ${{ github.token }} extra-files: description: 'List of files that are scanned for version references.' required: false default: "" - # Remember to update docs/reference/github-action.md outputs: {} runs: using: 'docker' - image: ghcr.io/apricote/releaser-pleaser:v0.2.0 # x-releaser-pleaser-version + image: ghcr.io/apricote/releaser-pleaser:v0.2.0-beta.2 # x-releaser-pleaser-version args: - run - --forge=github diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 1125209..7214617 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -19,7 +19,6 @@ # Reference -- [Glossary](reference/glossary.md) - [Pull Request Options](reference/pr-options.md) - [GitHub Action](reference/github-action.md) - [GitLab CI]() diff --git a/docs/book.toml b/docs/book.toml index e4acb5f..c109a67 100644 --- a/docs/book.toml +++ b/docs/book.toml @@ -4,5 +4,5 @@ multilingual = false src = "." title = "releaser-pleaser" -[output.html] -git-repository-url = "https://github.com/apricote/releaser-pleaser" +[build] +build-dir = "book" diff --git a/docs/explanation/release-pr.md b/docs/explanation/release-pr.md index 359710c..f043db4 100644 --- a/docs/explanation/release-pr.md +++ b/docs/explanation/release-pr.md @@ -1,21 +1 @@ # Release Pull Request - -A _release pull request_ is opened by `releaser-pleaser` when it detects that there are _releasable changes_. -The pull request contains an _auto-generated Changelog_ and a _suggested next version_. -Once someone merges this pull request, `releaser-pleaser` will create a matching Git Tag and Release on GitHub/GitLab. - -Maintainers can fill various fields in the pull request description and through labels to change the proposed release. Some examples of this are: _Changelog Prefix & Suffix text_ and _requesting a pre-release_ (`alpha`, `beta`, `rc`) version. - -The pull request is automatically updated by `releaser-pleaser` every time it runs. - -### Example Screenshot - - - -## Related Documentation - -- **Guide** - - [Pre-releases](../guides/pre-releases.md) - - [Release Notes](../guides/release-notes.md) -- **Reference** - - [Pull Request Options](../reference/pr-options.md) diff --git a/docs/explanation/release-pr.png b/docs/explanation/release-pr.png deleted file mode 100644 index 6a208ae..0000000 --- a/docs/explanation/release-pr.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:86cd4b5e6a24a1f77bfa882ea330c8af7f88967011a7adab7e24c236104cefe5 -size 96399 diff --git a/docs/guides/github-workflow-permissions.md b/docs/guides/github-workflow-permissions.md index b27484c..45b87fb 100644 --- a/docs/guides/github-workflow-permissions.md +++ b/docs/guides/github-workflow-permissions.md @@ -1,83 +1 @@ # Workflow Permissions on GitHub - -## Default GitHub token permissions - -The [GitHub](../tutorials/github.md) tutorial uses the builtin `GITHUB_TOKEN` for the action to get access to the repository. It uses the following permissions on the token: - -```yaml -jobs: - releaser-pleaser: - permissions: - # - list commits - # - push commits for the release pull request - # - push new releases & tags - contents: write - - # - read pull requests for Changelog - # - read and write release pull request - # - create labels on the repository - pull-requests: write -``` - -These permissions are sufficient for simple operations. But fail if you want to run another workflow on `push: tag`. - -## Workflows on Tag Push - -When using the automatic `GITHUB_TOKEN` to create tags, GitHub does not create new workflow runs that are supposed to be created. This is done to prevent the user from "accidentally creating recursive workflow runs". You can read more about this behaviour in the [GitHub Actions docs](https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow). - -Workflows that have a trigger on pushed tags are often used to build artifacts for the release, like binaries or container images. - -```yaml -on: - push: - tags: - - "v*.*.*" -``` - -To circumvent this restriction, you can create a personal access token and instruct `releaser-pleaser` to use that instead to talk to GitHub. - -### 1. Create Personal Access Token - -On your account settings, navigate to the [Personal access tokens](https://github.com/settings/tokens?type=beta) section. - -You can either use a "Fine-grained" or "Classic" token for this. Fine-grained tokens can be restricted to specific actions and repositories and are more secure because of this. On the other hand they have a mandatory expiration of 1 year maximum. Classic tokens have unrestricted access to your account, but do not expire. - -Copy the token for the next step. - -#### Fine-grained token - -When you create a fine-grained token, restrict the access to the repository where you are using `releaser-pleaser`. - -In the **repository permissions** you need to give **read and write** access for **Contents** and **Pull requests**. All other permissions can be set to **No access** (default). - -No **account permissions** are required and you can set all to **No access** (default). - -### 2. Repository Secret - -Next you need to add the personal access token as a repository secret. - -Open the repository settings to **Secrets and variables > Actions**: - -> `https://github.com/YOUR-NAME/YOUR-REPO/settings/secrets/actions` - -Click on **New repository secret** and add the personal access token to a secret named `RELEASER_PLEASER_TOKEN`. - -### 3. Update Workflow - -Update the workflow file (`.github/workflows/releaser-pleaser.yaml`) to pass the new secret to the `releaser-pleaser` action. You can also remove the permissions of the job, as they are now unused. - -```diff - jobs: - releaser-pleaser: - runs-on: ubuntu-latest # The action uses docker containers -- permissions: -- contents: write -- pull-requests: write - steps: - - name: releaser-pleaser - uses: apricote/releaser-pleaser@v0.2.0 -+ with: -+ token: ${{ secrets.RELEASER_PLEASER_TOKEN }} -``` - -The next release created by releaser-pleaser will now create the follow-up workflows as expected. diff --git a/docs/guides/pre-releases.md b/docs/guides/pre-releases.md index c7f8c23..fd2bbf8 100644 --- a/docs/guides/pre-releases.md +++ b/docs/guides/pre-releases.md @@ -1,38 +1 @@ # Pre-releases - -Pre-releases are a concept of [SemVer](#semantic-versioning-semver). They follow the normal versioning schema but use a suffix out of `-alpha.X`, `-beta.X` and `-rc.X`. - -Pre-releases are not considered "stable" and are usually not recommended for most users. - -## Creating a pre-release - -If you want to create a pre-release, you can set **one** of the following labels on the release pull request: - -- `rp-next-version::alpha` -- `rp-next-version::beta` -- `rp-next-version::rc` - -This will cause `releaser-pleaser` to run, and it will change the release pull request to a matching version according to the type of pre-release. - -## Versioning - -For pre-releases, `releaser-pleaser` analyzes the commits made since the **last stable release**. The version bump from this is then applied to the last stable release and the pre-release info is added to the version number. If a previous pre-release of the matching type exists, the "pre-release counter" at the end of the version is increased by one. - -An examples: - -- The last stable version was `v1.0.0` -- Since then a `feat` commit was merged, this causes a bump of the minor version: `v1.1.0` -- The release pull request has the label `rp-next-version::beta`. This changes the suggested version to `v1.1.0-beta.0` - -If there was already a `v1.1.0-beta.0`, then the suggested version would be `v1.1.0-beta.1`. - -Changing the pre-release type (for example from `beta` to `rc`), resets the counter. `v1.1.0-beta.1` would be followed by `v1.1.0-rc.0`. - -## Stable Release - -`releaser-pleaser` ignores pre-releases when looking for releasable commits. This means that right after creating a new pre-release, `releaser-pleaser` again detects releasable commits and opens a new release pull request for the stable version. - -## Related Documentation - -- **Reference** - - [Pull Request Options](../reference/pr-options.md) diff --git a/docs/guides/release-notes-collapsible.png b/docs/guides/release-notes-collapsible.png deleted file mode 100644 index 05c721b..0000000 --- a/docs/guides/release-notes-collapsible.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:74f5f39210bdf9c55f7cec64d4b12465b569646efdfbb2e3eb08b32277cd5145 -size 3357 diff --git a/docs/guides/release-notes.md b/docs/guides/release-notes.md index b4602c9..ed1d1e2 100644 --- a/docs/guides/release-notes.md +++ b/docs/guides/release-notes.md @@ -1,54 +1 @@ # Customizing Release Notes - -You can customize the generated Release Notes in two ways: - -## For a single commit / pull request - -This feature is still being worked on. Check out [#5](https://github.com/apricote/releaser-pleaser/issues/5) for the current status. - -## For the release - -It is possible to add custom **prefix** and **suffix** Markdown-formatted text to the Release Notes. - -The release pull request description has text fields where maintainers can add the prefix and suffix. To see these fields, toggle the collapsible section in the description: - - - -When you edit the description, make sure to put your desired content into the code blocks named `rp-prefix` and `rp-suffix`. Only the content of these blocks is considered. - -> ```rp-prefix -> ### Prefix -> -> This will be shown as the Prefix. -> ``` -> -> ```rp-suffix -> ### Suffix -> -> This will be shown as the Suffix. -> ``` - -To match the style of the auto-generated release notes, you should start any headings at level 3 (`### Title`). - -Once the description was updated `releaser-pleaser` automatically runs again and adds the prefix and suffix to the Release Notes and to the committed Changelog: - -```markdown -## v1.1.0 - -### Prefix - -This will be shown as the Prefix. - -### Features - -- Added cool new thing (#1) - -### Suffix - -This will be shown as the Suffix. -``` - -## Related Documentation - -- **Reference** - - [Pull Request Options](../reference/pr-options.md) diff --git a/docs/reference/github-action.md b/docs/reference/github-action.md index eec9789..2bc8ce9 100644 --- a/docs/reference/github-action.md +++ b/docs/reference/github-action.md @@ -1,25 +1 @@ # GitHub Action - -## Reference - -The action is available as `apricote/releaser-pleaser` on GitHub.com. - -## Versions - -The `apricote/releaser-pleaser` action is released together with `releaser-pleaser` and they share the version number. - -The action does not support floating tags (e.g. `v1`) right now ([#31](https://github.com/apricote/releaser-pleaser/issues/31)). You have to use the full version or commit SHA instead: `apricote/releaser-pleaser@v0.2.0`. - -## Inputs - -The following inputs are supported by the `apricote/releaser-pleaser` GitHub Action. - -| Input | Description | Default | Example | -| ------------- | :----------------------------------------------------- | --------------: | -------------------------------------------------------------------: | -| `branch` | This branch is used as the target for releases. | `main` | `master` | -| `token` | GitHub token for creating and updating release PRs | `$GITHUB_TOKEN` | `${{secrets.RELEASER_PLEASER_TOKEN}}` | -| `extra-files` | List of files that are scanned for version references. | `""` |
version/version.go
deploy/deployment.yaml |
-
-## Outputs
-
-The action does not define any outputs.
diff --git a/docs/reference/glossary.md b/docs/reference/glossary.md
deleted file mode 100644
index 543f970..0000000
--- a/docs/reference/glossary.md
+++ /dev/null
@@ -1,47 +0,0 @@
-# Glossary
-
-### Changelog
-
-The Changelog is a file in the repository (`CHANGELOG.md`) that contains the [Release Notes](#release-notes) for every release of that repository. Usually, new releases are added at the top of the file.
-
-### Conventional Commits
-
-[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) is a specification for commit messages. It is the only supported commit message schema in `releaser-pleaser`. Follow the link to learn more.
-
-### Forge
-
-A **forge** is a web-based collaborative software platform for both developing and sharing computer applications.[^wp-forge]
-
-Right now only **GitHub** is supported. We plan to support **GitLab** in the future ([#4](https://github.com/apricote/releaser-pleaser/issues/4)). For other forges like Forgejo or Gitea, please open an issue and submit a pull request.
-
-[^wp-forge]: Quote from [Wikipedia "Forge (software)"](