{"id":13527749,"url":"https://github.com/go-semantic-release/semantic-release","last_synced_at":"2025-05-16T04:06:18.110Z","repository":{"id":18544018,"uuid":"84316836","full_name":"go-semantic-release/semantic-release","owner":"go-semantic-release","description":"📦🚀 semantic-release written in Go","archived":false,"fork":false,"pushed_at":"2024-10-13T15:37:57.000Z","size":3766,"stargazers_count":450,"open_issues_count":30,"forks_count":46,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-14T16:21:27.677Z","etag":null,"topics":["github","github-actions","gitlab","gitlab-ci","go","semantic-release","semantic-version","semantic-versioning","semver"],"latest_commit_sha":null,"homepage":"https://go-semantic-release.xyz","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/go-semantic-release.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2017-03-08T12:16:36.000Z","updated_at":"2025-05-06T12:28:46.000Z","dependencies_parsed_at":"2024-02-29T19:47:14.227Z","dependency_job_id":"f14e4a42-d64d-4145-ae9d-191aa1d44763","html_url":"https://github.com/go-semantic-release/semantic-release","commit_stats":{"total_commits":341,"total_committers":12,"mean_commits":"28.416666666666668","dds":"0.11143695014662758","last_synced_commit":"b11b1695a6b81c7fbf6be77d1d8955b91ff70115"},"previous_names":["semantic-release/go-semantic-release","go-semantic-release/go-semantic-release","christophwitzko/go-semantic-release"],"tags_count":93,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-semantic-release%2Fsemantic-release","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-semantic-release%2Fsemantic-release/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-semantic-release%2Fsemantic-release/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-semantic-release%2Fsemantic-release/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-semantic-release","download_url":"https://codeload.github.com/go-semantic-release/semantic-release/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254464895,"owners_count":22075570,"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":["github","github-actions","gitlab","gitlab-ci","go","semantic-release","semantic-version","semantic-versioning","semver"],"created_at":"2024-08-01T06:01:59.751Z","updated_at":"2025-05-16T04:06:13.100Z","avatar_url":"https://github.com/go-semantic-release.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# :package::rocket: semantic-release\n[![CI](https://github.com/go-semantic-release/semantic-release/workflows/CI/badge.svg?branch=master)](https://github.com/go-semantic-release/semantic-release/actions?query=workflow%3ACI+branch%3Amaster)\n[![pipeline status](https://gitlab.com/go-semantic-release/semantic-release/badges/master/pipeline.svg)](https://gitlab.com/go-semantic-release/semantic-release/pipelines)\n[![Go Report Card](https://goreportcard.com/badge/github.com/go-semantic-release/semantic-release)](https://goreportcard.com/report/github.com/go-semantic-release/semantic-release)\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/go-semantic-release/semantic-release/v2)](https://pkg.go.dev/github.com/go-semantic-release/semantic-release/v2)\n\n\u003e fully automated package/module/image publishing\n\nThis project aims to be an alternative to the original [semantic-release](https://github.com/semantic-release/semantic-release) implementation. Using Go, `semantic-release` can be installed by downloading a single binary and is, therefore, easier to install and does not require Node.js and npm. Furthermore, `semantic-release` has a built-in plugin system that allows to extend and customize its functionality.\n\n### Features\n\n- Automated version and release management\n- No external dependencies required\n- Runs on Linux, macOS and Windows\n- Fully extensible via plugins\n- Automated changelog generation\n- Supports GitHub, GitLab and git\n- Support for maintaining multiple major version releases\n\n## How does it work?\nInstead of writing [meaningless commit messages](http://whatthecommit.com/), we can take our time to think about the changes in the codebase and write them down. Following the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification it is then possible to generate a helpful changelog and to derive the next semantic version number from them.\n\nWhen `semantic-release` is setup it will do that after every successful continuous integration build of your default branch and publish the new version for you. This way no human is directly involved in the release process and your releases are guaranteed to be unromantic and unsentimental.\n\n_Source: [semantic-release/semantic-release#how-does-it-work](https://github.com/semantic-release/semantic-release#how-does-it-work)_\n\nYou can enforce semantic commit messages using [a git hook](https://github.com/hazcod/semantic-commit-hook).\n\n## Installation\n\n\n### Option 1: Use the go-semantic-release GitHub Action ([go-semantic-release/action](https://github.com/go-semantic-release/action))\n\n### Option 2: Install manually\n\n```bash\ncurl -SL https://get-release.xyz/semantic-release/linux/amd64 -o ./semantic-release \u0026\u0026 chmod +x ./semantic-release\n```\n\n### Option 3: Install via npm\n\n```bash\nnpm install -g go-semantic-release\n```\n\n## Examples\n\n### Releasing a Go application with GitHub Actions\nFull example can be found at [go-semantic-release/example-go-application](https://github.com/go-semantic-release/example-go-application).\n\nExample [.github/workflows/ci.yml](https://github.com/go-semantic-release/example-go-application/blob/main/.github/workflows/ci.yml) config:\n```yaml\nname: CI\non:\n  push:\n    branches:\n      - '**'\n  pull_request:\n    branches:\n      - '**'\njobs:\n  lint:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n      - uses: actions/setup-go@v3\n        with:\n          go-version: 1.19\n      - uses: golangci/golangci-lint-action@v3\n  test:\n    runs-on: ubuntu-latest\n    needs: lint\n    steps:\n      - uses: actions/checkout@v3\n      - uses: actions/setup-go@v3\n        with:\n          go-version: 1.19\n      - run: go test -v ./...\n  release:\n    runs-on: ubuntu-latest\n    needs: test\n    permissions:\n      contents: write\n    steps:\n      - uses: actions/checkout@v3\n      - uses: actions/setup-go@v3\n        with:\n          go-version: 1.19\n      - uses: go-semantic-release/action@v1\n        with:\n          hooks: goreleaser\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\n### Example GitLab CI Config\n\n#### GitLab token\nIt is necessary to create a new Gitlab personal access token with the `api` scope [here](https://gitlab.com/profile/personal_access_tokens).\nEnsure the CI variable is protected and masked as the `GITLAB_TOKEN` has a lot of rights. There is an open issue for project specific [tokens](https://gitlab.com/gitlab-org/gitlab/issues/756)\nYou can set the GitLab token via the `GITLAB_TOKEN` environment variable or the `-token` flag.\n\n.gitlab-ci.yml\n```yml\nstages:\n  # other stages\n  - release\n\nrelease:\n  image:\n    name: registry.gitlab.com/go-semantic-release/semantic-release:latest\n    entrypoint: [\"\"]\n  stage: release\n  # when: manual # Add this if you want to manually create releases\n  only:\n    - master\n  script:\n    - semantic-release # Add --allow-no-changes if you want to create a release for each push\n```\n\n#### Job Token\nIf you do not provide a PAT the [job token](https://docs.gitlab.com/ee/ci/jobs/ci_job_token.html) will be used.\nThis restricted token can create releases but not read commits. The [git strategy](https://docs.gitlab.com/ee/ci/runners/configure_runners.html#git-strategy)\nmust be set to clone so that we can read the commits from the repository. See example below\n\n.gitlab-ci.yml\n```yml\nvariables:\n  GIT_STRATEGY: clone\n\nstages:\n  # other stages\n  - release\n\nrelease:\n  image:\n    name: registry.gitlab.com/go-semantic-release/semantic-release:latest\n    entrypoint: [\"\"]\n  stage: release\n  # when: manual # Add this if you want to manually create releases\n  only:\n    - master\n  script:\n    - semantic-release\n    # - semantic-release --allow-no-changes # create a release for each push\n    # - semantic-release --provider gitlab --provider-opt log_order=ctime # traverse commits by committer time (commits in merge requests will affect the calculated version) \n```\n\n### Releasing a Go application with GitLab CI\nThe full example can be found at https://gitlab.com/go-semantic-release/example-go-application.\n\nExample [.gitlab-ci.yml](https://gitlab.com/go-semantic-release/example-go-application/-/blob/main/.gitlab-ci.yml) config:\n```yaml\nimage: golang:1.19\n\nstages:\n  - test\n  - release\n\ntest:\n  stage: test\n  except:\n    - tags\n  script:\n    - go test -v ./...\n    - go build ./\n    - ./example-go-application\n\nrelease:\n  stage: release\n  only:\n    - main\n  script:\n    - curl -SL https://get-release.xyz/semantic-release/linux/amd64 -o ./semantic-release \u0026\u0026 chmod +x ./semantic-release\n    - ./semantic-release --hooks goreleaser\n```\n\n## Plugin System\n\nSince v2, semantic-release is equipped with a plugin system. The plugins are standalone binaries that use [hashicorp/go-plugin](https://github.com/hashicorp/go-plugin) as a plugin library. `semantic-release` automatically downloads the necessary plugins if they don't exist locally. The plugins are stored in the `.semrel` directory of the current working directory in the following format: `.semrel/\u003cos\u003e_\u003carch\u003e/\u003cplugin name\u003e/\u003cversion\u003e/`. The go-semantic-release plugins registry (https://registry.go-semantic-release.xyz/) is used to resolve plugins and to download the correct binary. With the new [plugin-registry](https://github.com/go-semantic-release/plugin-registry) service the API also supports batch requests to resolve multiple plugins at once and caching of the plugins.\n\n### Running semantic-release in an air-gapped environment\nAs plugins are only downloaded if they do not exist in the `.semrel` folder, it is possible to download the plugins and archive the `.semrel` folder. This way it is possible to run `semantic-release` in an air-gapped environment.\n\n```bash\n# specify all required plugins and download them\n./semantic-release --download-plugins --show-progress --provider github --ci-condition github --hooks goreleaser\n# archive the .semrel folder\ntar -czvf ./semrel-plugins.tgz .semrel/\n\n# copy the archive to the air-gapped environment\n\n# extract the archive\ntar -xzvf ./semrel-plugins.tgz\n# run semantic-release\n./semantic-release --provider github --condition github --hooks goreleaser\n```\n\n### Plugins\n\n* Provider ([Docs](https://pkg.go.dev/github.com/go-semantic-release/semantic-release/v2/pkg/provider?tab=doc#Provider))\n  * [GitHub](https://github.com/go-semantic-release/provider-github)\n  * [GitLab](https://github.com/go-semantic-release/provider-gitlab)\n  * [Git](https://github.com/go-semantic-release/provider-git)\n* CI Condition ([Docs](https://pkg.go.dev/github.com/go-semantic-release/semantic-release/v2/pkg/condition?tab=doc#CICondition))\n  * [GitHub Actions](https://github.com/go-semantic-release/condition-github)\n  * [GitLab CI](https://github.com/go-semantic-release/condition-gitlab)\n  * [Bitbucket Pipelines](https://github.com/go-semantic-release/condition-bitbucket)\n  * [Default](https://github.com/go-semantic-release/condition-default)\n* Commit Analyzer ([Docs](https://pkg.go.dev/github.com/go-semantic-release/semantic-release/v2/pkg/analyzer?tab=doc#CommitAnalyzer))\n  * [Conventional Commits](https://github.com/go-semantic-release/commit-analyzer-cz)\n* Changelog Generator ([Docs](https://pkg.go.dev/github.com/go-semantic-release/semantic-release/v2/pkg/generator?tab=doc#ChangelogGenerator))\n  * [Default](https://github.com/go-semantic-release/changelog-generator-default)\n* Hooks ([Docs](https://pkg.go.dev/github.com/go-semantic-release/semantic-release/v2/pkg/hooks?tab=doc#Hooks))\n  * [GoReleaser](https://github.com/go-semantic-release/hooks-goreleaser)\n  * [npm-binary-releaser](https://github.com/go-semantic-release/hooks-npm-binary-releaser)\n  * [plugin-registry-update](https://github.com/go-semantic-release/hooks-plugin-registry-update)\n  * [exec](https://github.com/go-semantic-release/hooks-exec)\n* Files Updater ([Docs](https://pkg.go.dev/github.com/go-semantic-release/semantic-release/v2/pkg/updater?tab=doc#FilesUpdater))\n  * [npm](https://github.com/go-semantic-release/files-updater-npm)\n  * [helm](https://github.com/go-semantic-release/files-updater-helm)\n\n### Configuration\n\nPlugins can be configured using CLI flags or the `.semrelrc` config file. By using a `@` sign after the plugin name, the required version of the plugin can be specified. Otherwise, any locally installed version will be used. If the plugin does not exist locally, the latest version will be downloaded. This is an example of the `.semrelrc` config file:\n\n```json\n{\n  \"plugins\": {\n    \"commit-analyzer\": {\n      \"name\": \"default@^1.0.0\"\n    },\n    \"ci-condition\": {\n      \"name\": \"default\"\n    },\n    \"changelog-generator\": {\n      \"name\": \"default\",\n      \"options\": {\n        \"emojis\": \"true\"\n      }\n    },\n    \"provider\": {\n      \"name\": \"gitlab\",\n      \"options\": {\n        \"gitlab_projectid\": \"123456\"\n      }\n    },\n    \"files-updater\": {\n      \"names\": [\"npm\"]\n    }\n  }\n}\n```\n\n## Beta release support\nBeta release support empowers you to release beta, rc, etc. versions with `semantic-release` (e.g. v2.0.0-beta.1). To enable this feature you need to create a new branch (e.g. beta/v2) and check in a `.semrelrc` file with the following content:\n```\n{\n  \"maintainedVersion\": \"2-beta\"\n}\n```\nIf you commit to this branch a new incremental pre-release is created everytime you push. (2.0.0-beta.1, 2.0.0-beta.2, ...)\n\n## Licence\n\nThe [MIT License (MIT)](http://opensource.org/licenses/MIT)\n\nCopyright © 2024 [Christoph Witzko](https://twitter.com/christophwitzko)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-semantic-release%2Fsemantic-release","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-semantic-release%2Fsemantic-release","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-semantic-release%2Fsemantic-release/lists"}