{"id":15147460,"url":"https://github.com/barbiecue/git-tags-with-gradle","last_synced_at":"2026-01-18T23:35:02.508Z","repository":{"id":257179488,"uuid":"857339135","full_name":"BarbieCue/git-tags-with-gradle","owner":"BarbieCue","description":"A minimalistic example on how to create git tags via Gradle in your pipeline","archived":false,"fork":false,"pushed_at":"2025-02-25T13:47:57.000Z","size":146,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T01:13:53.776Z","etag":null,"topics":["git","git-tag","gradle","pipeline"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BarbieCue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-09-14T11:48:32.000Z","updated_at":"2024-10-03T08:34:34.000Z","dependencies_parsed_at":"2025-01-24T17:35:31.433Z","dependency_job_id":null,"html_url":"https://github.com/BarbieCue/git-tags-with-gradle","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"cb3a2c521455bea6e0c12d55b2631ca1584e5a03"},"previous_names":["barbiecue/git-tags-with-gradle"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BarbieCue%2Fgit-tags-with-gradle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BarbieCue%2Fgit-tags-with-gradle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BarbieCue%2Fgit-tags-with-gradle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BarbieCue%2Fgit-tags-with-gradle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BarbieCue","download_url":"https://codeload.github.com/BarbieCue/git-tags-with-gradle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247574092,"owners_count":20960496,"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":["git","git-tag","gradle","pipeline"],"created_at":"2024-09-26T12:41:35.349Z","updated_at":"2026-01-18T23:35:02.455Z","avatar_url":"https://github.com/BarbieCue.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git tags with Gradle\n\nPeople often want to create git tags\nout of their pipelines.\nFor example a git tag with the release version \nshould be set during the publication of a release.\n\nThis is a minimalistic example on how to\ncreate git tags using Gradle.\n\n- **A simple Gradle task**\n- **6 lines of code**\n- **No external dependencies**\n\n\n[*build.gradle.kts*](build.gradle.kts)\n```kotlin\ngroup = \"org.example\"\nversion = \"1.0.0\"\n\ntasks.register(\"gitTagVersion\") {\n    doLast {\n        exec { commandLine(\"git\", \"tag\", \"-a\", version, \"-m\", \"Release version $version\") }\n        exec { commandLine(\"git\", \"push\", \"origin\", \"tag\", version) }\n    }\n}\n```\n\n\n*Your pipeline (pseudocode)*\n\n```yml\n...\n  steps:\n    - name: build, test, other stuff ...\n    ...\n    \n    # And here we go:\n    \n    - name: Publish release version\n      script: ./gradlew publish\n\n    - name: Git tag version\n      script: ./gradlew gitTagVersion\n```\n\nThat is all you need.\n\n\n**Thoughts**\n\nBoth steps, publishing and git tagging,\ncan also be executed in parallel.\nHowever, there is a risk that publishing\nwill fail and the tag will then be\ncreated incorrectly.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarbiecue%2Fgit-tags-with-gradle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarbiecue%2Fgit-tags-with-gradle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarbiecue%2Fgit-tags-with-gradle/lists"}