Compare commits

...

11 commits

20 changed files with 140 additions and 11 deletions

40
.github/workflows/docs.yaml vendored Normal file
View file

@ -0,0 +1,40 @@
name: docs
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write # To push a branch
pages: write # To push to a GitHub Pages site
id-token: write # To update the deployment status
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install latest mdbook
run: |
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
mkdir mdbook
curl -sSL $url | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Build Book
run: |
# This assumes your book is in the root of your repository.
# Just add a `cd` here if you need to change to another directory.
cd docs
mdbook build
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: 'docs/book'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

View file

@ -5,6 +5,10 @@ on:
tags:
- "v*.*.*"
permissions:
contents: read
packages: write
jobs:
release:
runs-on: ubuntu-latest
@ -17,6 +21,5 @@ jobs:
with:
go-version-file: go.mod
- uses: ko-build/setup-ko@v0.7
- run: ko build --bare --tags ${{ github.ref_name }}
- run: ko build --bare --tags ${{ github.ref_name }} github.com/apricote/releaser-pleaser/cmd/rp

View file

@ -22,3 +22,5 @@ jobs:
uses: ./
with:
token: ${{ secrets.RELEASER_PLEASER_TOKEN }}
extra-files: |
action.yml

View file

@ -1,5 +1,40 @@
# Changelog
## [v0.2.0](https://github.com/apricote/releaser-pleaser/releases/tag/v0.2.0)
### Features
- update version references in any files (#14)
### 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
- update version references in any files (#14)
### Bug Fixes
- **ci**: building release image fails (#21)
- **ci**: ko pipeline permissions (#23)
## [v0.2.0-beta.1](https://github.com/apricote/releaser-pleaser/releases/tag/v0.2.0-beta.1)
### Features
- update version references in any files (#14)
### Bug Fixes
- **ci**: building release image fails (#21)
## [v0.2.0-beta.0](https://github.com/apricote/releaser-pleaser/releases/tag/v0.2.0-beta.0)
### Features
- update version references in any files (#14)
## [v0.1.0](https://github.com/apricote/releaser-pleaser/releases/tag/v0.1.0)
### This is the first release ever, so it also includes a lot of other functionality.

View file

@ -19,12 +19,12 @@ inputs:
outputs: {}
runs:
using: 'docker'
image: ghcr.io/apricote/releaser-pleaser:v0.1.0 # x-releaser-pleaser-version
image: ghcr.io/apricote/releaser-pleaser:v0.2.0 # x-releaser-pleaser-version
args:
- run
- --forge=github
- --branch=${{ inputs.branch }}
- --extra-files="${{ inputs.extra-files }}"
- --extra-files=${{ inputs.extra-files }}
env:
GITHUB_TOKEN: ${{ inputs.token }}
GITHUB_USER: "oauth2"

1
docs/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
book

28
docs/SUMMARY.md Normal file
View file

@ -0,0 +1,28 @@
# Summary
[Introduction](introduction.md)
# Tutorials
- [Getting started on GitHub](tutorials/github.md)
- [Getting started on GitLab]()
# Explanation
- [Release Pull Request](explanation/release-pr.md)
# Guides
- [Customizing Release Notes](guides/release-notes.md)
- [Pre-releases](guides/pre-releases.md)
- [Workflow Permissions on GitHub](guides/github-workflow-permissions.md)
# Reference
- [Pull Request Options](reference/pr-options.md)
- [GitHub Action](reference/github-action.md)
- [GitLab CI]()
---
[Changelog](changelog.md)

8
docs/book.toml Normal file
View file

@ -0,0 +1,8 @@
[book]
language = "en"
multilingual = false
src = "."
title = "releaser-pleaser"
[build]
build-dir = "book"

3
docs/changelog.md Normal file
View file

@ -0,0 +1,3 @@
# Changelog
{{#include ../CHANGELOG.md:2: }}

View file

@ -0,0 +1 @@
# Release Pull Request

View file

@ -0,0 +1 @@
# Workflow Permissions on GitHub

View file

@ -0,0 +1 @@
# Pre-releases

View file

@ -0,0 +1 @@
# Customizing Release Notes

3
docs/introduction.md Normal file
View file

@ -0,0 +1,3 @@
# Introduction
{{#include ../README.md:2:}}

View file

@ -0,0 +1 @@
# GitHub Action

View file

@ -0,0 +1 @@
# Pull Request Options

1
docs/tutorials/github.md Normal file
View file

@ -0,0 +1 @@
# GitHub

2
go.mod
View file

@ -17,7 +17,7 @@ require (
dario.cat/mergo v1.0.1 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/ProtonMail/go-crypto v1.0.0 // indirect
github.com/cloudflare/circl v1.3.9 // indirect
github.com/cloudflare/circl v1.4.0 // indirect
github.com/cyphar/filepath-securejoin v0.3.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emirpasic/gods v1.18.1 // indirect

4
go.sum
View file

@ -13,8 +13,8 @@ github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
github.com/cloudflare/circl v1.3.9 h1:QFrlgFYf2Qpi8bSpVPK1HBvWpx16v/1TZivyo7pGuBE=
github.com/cloudflare/circl v1.3.9/go.mod h1:PDRU+oXvdD7KCtgKxW95M5Z8BpSCJXQORiZFnBQS5QU=
github.com/cloudflare/circl v1.4.0 h1:BV7h5MgrktNzytKmWjpOtdYrf0lkkbF8YMlBGPhJQrY=
github.com/cloudflare/circl v1.4.0/go.mod h1:PDRU+oXvdD7KCtgKxW95M5Z8BpSCJXQORiZFnBQS5QU=
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cyphar/filepath-securejoin v0.3.1 h1:1V7cHiaW+C+39wEfpH6XlLBQo3j/PciWFrgfCLS8XrE=
github.com/cyphar/filepath-securejoin v0.3.1/go.mod h1:F7i41x/9cBF7lzCrVsYs9fuzwRZm4NQsGTBdpp6mETc=

View file

@ -45,6 +45,9 @@ func SemVerNextVersion(r Releases, versionBump conventionalcommits.VersionBump,
case conventionalcommits.MajorVersion:
err = next.IncrementMajor()
}
if err != nil {
return "", err
}
switch nextVersionType {
case NextVersionTypeUndefined, NextVersionTypeNormal:
@ -62,10 +65,6 @@ func SemVerNextVersion(r Releases, versionBump conventionalcommits.VersionBump,
setPRVersion(&next, nextVersionType.String(), id)
}
if err != nil {
return "", err
}
return "v" + next.String(), nil
}