{"id":16430921,"url":"https://github.com/nightapes/go-semantic-release","last_synced_at":"2025-08-14T08:41:23.379Z","repository":{"id":42174247,"uuid":"186377314","full_name":"Nightapes/go-semantic-release","owner":"Nightapes","description":"automatic release","archived":false,"fork":false,"pushed_at":"2023-05-11T20:45:10.000Z","size":422,"stargazers_count":43,"open_issues_count":10,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-01T02:51:09.436Z","etag":null,"topics":["docker","github","github-actions","gitlab","semantic-release","travis"],"latest_commit_sha":null,"homepage":"https://nightapes.github.io/go-semantic-release/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nightapes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-13T08:26:20.000Z","updated_at":"2024-12-25T19:06:47.000Z","dependencies_parsed_at":"2024-06-20T02:55:50.124Z","dependency_job_id":"33bca09a-021e-4122-8e53-9df7055c6c63","html_url":"https://github.com/Nightapes/go-semantic-release","commit_stats":null,"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nightapes%2Fgo-semantic-release","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nightapes%2Fgo-semantic-release/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nightapes%2Fgo-semantic-release/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nightapes%2Fgo-semantic-release/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nightapes","download_url":"https://codeload.github.com/Nightapes/go-semantic-release/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244110101,"owners_count":20399562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","github","github-actions","gitlab","semantic-release","travis"],"created_at":"2024-10-11T08:28:45.181Z","updated_at":"2025-03-21T04:31:51.567Z","avatar_url":"https://github.com/Nightapes.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-semantic-release\n\n![go-semantic-release](https://github.com/Nightapes/go-semantic-release/workflows/Go/badge.svg)\n\n## Release Types\n\n| Type        |    Implemented     |      Git tag       |     Changelog      |      Release       |  Write access git  |     Api token      |\n| ----------- | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: |\n| `github`    | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |                    | :white_check_mark: |\n| `gitlab`    | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |                    | :white_check_mark: |\n| `git`       | :white_check_mark: | :white_check_mark: |                    |                    | :white_check_mark: |                    |\n| `bitbucket` |    Comming soon    | :white_check_mark: |                    |                    | :white_check_mark: |                    |\n\n\n## Supported CI Pipelines\n\n* Github Actions\n* Gitlab CI\n* Travis CI\n* Custom CI, set enviroment `CI=true`\n\n## Download\n\nYou can download the newest version under [releases](https://github.com/Nightapes/go-semantic-release/releases)\n\nor\n\nyou can use a Docker image\n\n`docker pull nightapes/go-semantic-release:\u003cVERSION\u003e` or `docker pull docker.pkg.github.com/nightapes/go-semantic-release/go-semantic-release:\u003cVERSION\u003e`\n\n\n\n## How to use\n\n`go-semantic-release` config file \nCreate a file with the name `.release.yml` or anything else, but you need to set to every command `-c \u003cyour config file\u003e`\n\n### Example config\n\n```yml\ncommitFormat: angular\nbranch:\n  master: release\nrelease: 'github'\ngithub:\n  repo: \"go-semantic-release\"\n  user: \"nightapes\"\nassets:\n  - name: ./build/go-semantic-release\n    compress: false\n  - name: ./build/go-semantic-release.exe\n    compress: false\nhooks:\n  preRelease:\n    - name: echo $RELEASE_VERSION\n  postRelease:\n    - name: echo $RELEASE_VERSION\nintegrations:\n  npm:\n    enabled: true\n```\n\n#### CommitFormat\n\nSupported formats:\n\n* [angular](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit-message-format)\n\n    ```yml\n    commitFormat: angular\n    ```\n\n* [conventional](https://www.conventionalcommits.org/en/v1.0.0/#summaryhttps://www.conventionalcommits.org/en/v1.0.0/#summary)\n\n    ```yml\n    commitFormat: conventional\n    ```\n\n#### Branch\n\nYou can define which kind of release should be created for different branches. \n\nSupported release kinds: \n\n* `release` -\u003e `v1.0.0`\n* `rc` -\u003e `v1.0.0-rc.0`\n* `beta` -\u003e `v1.0.0-beta.0`\n* `alpha` -\u003e `v1.0.0-alpha.0`\n\nAdd a branch config to your config\n\n```yml\nbranch:\n  \u003cbranch-name\u003e: \u003ckind\u003e\n```\n\n#### Release\n\nAt the moment we support releases to gitlab and github.\n\n##### Github \n\nYou need to set the env `GITHUB_TOKEN` with an access token.\n\n```yml\nrelease: 'github'\ngithub:\n  user: \"\u003cuser/group\"\n  repo: \"\u003crepositroyname\u003e\"\n  ## Optional, if you are not using github.com\n  customUrl: \u003chttps://your.github\u003e\n  ## Optional, if you want to change the default tag prefix (\"v\")\n  tagPrefix: \"\"\n```\n\n##### Gitlab \n\nYou need to set the env `GITLAB_ACCESS_TOKEN` with an personal access token.\n\n```yml\nrelease: 'gitlab'\ngitlab:\n  repo: \"\u003crepositroyname\u003e\"  ## Example group/project\n  ## Optional, if your not using gitlab.com\n  customUrl: \u003chttps://your.gitlab\u003e\n  ## Optional, if you want to change the default tag prefix (\"v\")\n  tagPrefix: \"\"\n```\n\nYou can find an example `.gitlab-ci.yml` in the [examples](examples/.gitlab-ci.yml) folder.\n\n##### Git only \n\nOnly via https at the moment. You need write access to your git repository\n\n\n```yml\nrelease: 'git'\ngit:\n  email: \"\u003cemail\u003e\" # Used for creating tag\n  user: \"\u003cuser\u003e\" : # Used for creating tag and pushing\n  auth: \"\u003ctoken\u003e\" # Used for pushing, can be env \"$GIT_TOKEN\", will be replaced with env\n  ## Optional, if you want to change the default tag prefix (\"v\")\n  tagPrefix: \"\"\n```\n\n\n#### Assets\n\nYou can upload assets to a release\n\nSupport for gitlab and github.\nIf you want, you can let the file be compressed before uploading \n\n```yml\nassets:\n  - name: ./build/go-semantic-release\n    compress: false\n```\n\n#### Hooks\n\nHooks will run when calling `release`. Hooks run only if a release will be triggered. \nYou can define hooks which run before or after the release. The shell commands will run in order, you can access the current release version via \nan environment variable `RELEASE_VERSION` \n\n```yml\nhooks:\n  preRelease:\n  - name: echo $RELEASE_VERSION\n  postRelease:\n  - name: echo $RELEASE_VERSION\n```\n\n#### Integrations\n\nIntegrations are simple helpers to make integration with existing tools easier.\nAt the moment npm is supported, the integration will set the version before release to the `package.json`\n```yml\nintegrations:\n  npm:\n    enabled: true\n```\n\n#### Changelog\n\nFollowing variables and objects can be used for templates:\n\n__Top level__\n\n| Field                 | Type              | Description |\n| --------              | ------            | -----       |\n|   `Commits`           | string            | Fully rendered commit messages. This is left for backward compatibility. |\n|   `CommitsContent`    | commitsContent    | Raw parsed commit data. Use this if you want to customize the output. |\n|\t`Version`           | string            | Next release version |\n| \t`Now`               | time.Time         | Current time of generating changelog |\n| \t`Backtick`          | string            | Backtick character |\n| \t`HasDocker`         | bool              | If a docker repository is set in the config. |\n| \t`HasDockerLatest`   | bool              | If `latest` image was uploaded |\n| \t`DockerRepository`  | string            | Docker repository |\n\n__commitsContent__\n\n| Field                 | Type                           | Description |\n| --------              | ------                         | -----       |\n|   `Commits`           | map[string][]AnalyzedCommit    | Commits grouped by commit type |\n|  \t`BreakingChanges`   | []AnalyzedCommit               | Analyzed commit structure |\n|  \t`Order`             | []string                       | Ordered list of types |\n|  \t`HasURL`            | bool                           | If a URL is available for commits |\n|  \t`URL`               | string                         | URL for to the commit with {{hash}} suffix |\n\n__AnalyzedCommit__\n\n| Field                 | Type                  | Description |\n| --------              | ------                | -----       |\n|   `Commit`            | Commit                | Original GIT commit |\n|  \t`Tag`               | string                | Type of commit (e.g. feat, fix, ...) |\n|  \t`TagString`         | string                | Full name of the type |\n|  \t`Scope`             | bool                  | Scope value from the commit |\n|  \t`Subject`           | string                | URL for to the commit with {{hash}} suffix |\n|   `MessageBlocks`     | map[string][]MessageBlock | Different sections of a message (e.g. body, footer etc.) |\n|  `IsBreaking`         | bool                  | If this commit contains a breaking change |\n|  `Print`              | bool                  | Should this commit be included in Changelog output |\n\n__Commit__\n\n| Field                 | Type                  | Description |\n| --------              | ------                | -----       |\n| `Message`             | string                | Original git commit message |\n| `Author`              | string                | Name of the author |\n| `Hash`                | string                | Commit hash value \"|\n\n__MessageBlock__\n\n| Field                 | Type                  | Description |\n| --------              | ------                | -----       |\n| `Label`               | string                | Label for a block (optional). This will usually be a token used in a footer |\n| `Content`             | string                | The parsed content of a block |\n\n```yml\nchangelog:\n  printAll: false ## Print all valid commits to changelog\n  title: \"v{{.Version}} ({{.Now.Format \"2006-01-02\"}})\" ## Used for releases (go template)\n  templatePath: \"./examples/changelog.tmpl\"    ## Path to a template file (go template)\n  showAuthors: false  ## Show authors in changelog\n  showBodyAsHeader: false  ## Show all bodies of the commits as header of changelog (useful for squash commit flow to show long text in release)\n\n```\n\n##### Docker \n\nYou can print a help text for a docker image\n\n```yml\nchangelog:\n  docker: \n    latest: false ## If you uploaded a latest image\n    repository: ## Your docker repository, which is used for docker run\n```\n\n##### NPM\n\nYou can print a help text for a npm package\n\n```yml\nchangelog:\n  npm:\n    name: ## Name of the npm package\n    repository: ## Your docker repository, which is used for docker run\n```\n\n\n### Version\n\n`go-semantic-release` has two modes for calculating the version: automatic or manual.\n\n#### Automatic\n\nVersion will be calculated on the `next` or `release` command\n\n#### Manual\n\nIf you don't want that `go-semantic-release` is calculating the version from the commits, you can set the version by hand with\nfollowing command:\n\n```bash\n./go-semantic-release set 1.1.1\n```\n\n### Print version\n\nPrint the next version, can be used to add version to your program\n\n```bash\n./go-semantic-release next // show next version (calculated by new commits since last version)\n./go-semantic-release last // show last released version \n```\nExample with go-lang\n\n```bash\ngo build -ldflags \"--X main.version=`./go-semantic-release next`\"\n```\n\n### Create release \n\n```bash\n./go-semantic-release release \n```\n\n### Write changelog to file\n\nThis will write all changes beginning from the last git tag til HEAD to a changelog file. \nDefault changelog file name if nothing is given via `--file`: `CHANGELOG.md`.\nNote that per default the new changelog will be prepended to the existing file.\nWith `--max-file-size` a maximum sizes of the changelog file in megabytes can be specified.\nIf the size exceeds the limit, the current changelog file will be moved to a new file called `\u003cfilename\u003e-\u003c1-n\u003e.\u003cfile extension\u003e`. The new changelog will be written to the `\u003cfilename\u003e`.\nThe default maximum file size limit is `10 megabytes`.\n\n```bash\n./go-semantic-release changelog --max-file-size 10\n```\n\nThis will overwrite the given changelog file if its existing, if not it will be created.\n```bash\n./go-semantic-release changelog --overwrite\n```\n\n\n\n## Build from source\n\n```bash\ngo build ./cmd/go-semantic-release/\n```\n\n### Testing\n\n```bash\ngo test ./... \n```\n\n### Linting\n\n```\ncurl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.16.0\ngolangci-lint run ./...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnightapes%2Fgo-semantic-release","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnightapes%2Fgo-semantic-release","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnightapes%2Fgo-semantic-release/lists"}