mirror of
https://github.com/apricote/releaser-pleaser.git
synced 2026-02-11 12:17:04 +00:00
Compare commits
3 commits
5e00562865
...
1767fbba90
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1767fbba90 | ||
| 2cd73a8679 | |||
| 1ede0bef10 |
5 changed files with 57 additions and 27 deletions
16
.github/workflows/releaser-pleaser.yaml
vendored
16
.github/workflows/releaser-pleaser.yaml
vendored
|
|
@ -3,6 +3,7 @@ name: releaser-pleaser
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
|
# TODO: use pull_request_target to avoid tainting the actual release PR with code from open feature pull requests
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
- edited
|
- edited
|
||||||
|
|
@ -18,6 +19,21 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version-file: go.mod
|
||||||
|
|
||||||
|
# Build container image from current commit and replace image ref in `action.yml`
|
||||||
|
# Without this, any new flags in `action.yml` would break the job in this repository until the new
|
||||||
|
# version is released. But a new version can only be released if this job works.
|
||||||
|
- uses: ko-build/setup-ko@v0.7
|
||||||
|
- run: ko build --bare --local --tags ci github.com/apricote/releaser-pleaser/cmd/rp
|
||||||
|
|
||||||
|
- run: mkdir -p .github/actions/releaser-pleaser
|
||||||
|
- run: "sed -i 's|image: .*$|image: ghcr.io/apricote/releaser-pleaser:ci|g' action.yml"
|
||||||
|
|
||||||
|
# Dogfood the action to make sure it works for users.
|
||||||
- name: releaser-pleaser
|
- name: releaser-pleaser
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
12
CHANGELOG.md
12
CHANGELOG.md
|
|
@ -1,5 +1,17 @@
|
||||||
# Changelog
|
# 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)
|
## [v0.2.0-beta.2](https://github.com/apricote/releaser-pleaser/releases/tag/v0.2.0-beta.2)
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ inputs:
|
||||||
outputs: {}
|
outputs: {}
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
image: ghcr.io/apricote/releaser-pleaser:v0.2.0-beta.2 # x-releaser-pleaser-version
|
image: ghcr.io/apricote/releaser-pleaser:v0.2.0 # x-releaser-pleaser-version
|
||||||
args:
|
args:
|
||||||
- run
|
- run
|
||||||
- --forge=github
|
- --forge=github
|
||||||
|
|
|
||||||
|
|
@ -1,31 +1,45 @@
|
||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime/debug"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
var logger *slog.Logger
|
var logger *slog.Logger
|
||||||
|
|
||||||
// rootCmd represents the base command when called without any subcommands
|
|
||||||
var rootCmd = &cobra.Command{
|
var rootCmd = &cobra.Command{
|
||||||
Use: "releaser-pleaser",
|
Use: "releaser-pleaser",
|
||||||
Short: "A brief description of your application",
|
Short: "",
|
||||||
Long: `A longer description that spans multiple lines and likely contains
|
Long: ``,
|
||||||
examples and usage of using your application. For example:
|
Version: version(),
|
||||||
|
}
|
||||||
Cobra is a CLI library for Go that empowers applications.
|
|
||||||
This application is a tool to generate the needed files
|
func version() string {
|
||||||
to quickly create a Cobra application.`,
|
vcsrevision := "unknown"
|
||||||
// Uncomment the following line if your bare application
|
vcsdirty := ""
|
||||||
// has an action associated with it:
|
|
||||||
// Run: func(cmd *cobra.Command, args []string) { },
|
buildInfo, ok := debug.ReadBuildInfo()
|
||||||
|
if ok {
|
||||||
|
fmt.Println(buildInfo.String())
|
||||||
|
for _, setting := range buildInfo.Settings {
|
||||||
|
switch setting.Key {
|
||||||
|
case "vcs.revision":
|
||||||
|
vcsrevision = setting.Value
|
||||||
|
case "vcs.modified":
|
||||||
|
if setting.Value == "true" {
|
||||||
|
vcsdirty = " (dirty)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return vcsrevision + vcsdirty
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute adds all child commands to the root command and sets flags appropriately.
|
|
||||||
// This is called by main.main(). It only needs to happen once to the rootCmd.
|
|
||||||
func Execute() {
|
func Execute() {
|
||||||
err := rootCmd.Execute()
|
err := rootCmd.Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -38,13 +52,4 @@ func init() {
|
||||||
Level: slog.LevelDebug,
|
Level: slog.LevelDebug,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
// Here you will define your flags and configuration settings.
|
|
||||||
// Cobra supports persistent flags, which, if defined here,
|
|
||||||
// will be global for your application.
|
|
||||||
|
|
||||||
// rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.releaser-pleaser.yaml)")
|
|
||||||
|
|
||||||
// Cobra also supports local flags, which will only run
|
|
||||||
// when this action is called directly.
|
|
||||||
rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ import (
|
||||||
rp "github.com/apricote/releaser-pleaser"
|
rp "github.com/apricote/releaser-pleaser"
|
||||||
)
|
)
|
||||||
|
|
||||||
// runCmd represents the run command
|
|
||||||
var runCmd = &cobra.Command{
|
var runCmd = &cobra.Command{
|
||||||
Use: "run",
|
Use: "run",
|
||||||
RunE: run,
|
RunE: run,
|
||||||
|
|
@ -25,8 +24,6 @@ var (
|
||||||
func init() {
|
func init() {
|
||||||
rootCmd.AddCommand(runCmd)
|
rootCmd.AddCommand(runCmd)
|
||||||
|
|
||||||
// Here you will define your flags and configuration settings.
|
|
||||||
|
|
||||||
runCmd.PersistentFlags().StringVar(&flagForge, "forge", "", "")
|
runCmd.PersistentFlags().StringVar(&flagForge, "forge", "", "")
|
||||||
runCmd.PersistentFlags().StringVar(&flagBranch, "branch", "main", "")
|
runCmd.PersistentFlags().StringVar(&flagBranch, "branch", "main", "")
|
||||||
runCmd.PersistentFlags().StringVar(&flagOwner, "owner", "", "")
|
runCmd.PersistentFlags().StringVar(&flagOwner, "owner", "", "")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue