File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11---
2- # Takes the version of elastic-apm in the Gemfile and creates a tag
2+ # Creates a new GitHub release if the version in Gemfile changed in the main branch and
33# if the tag does not exist yet.
44name : create-tag
55
1111 - Gemfile
1212
1313permissions :
14- contents : write
14+ contents : read
1515
1616jobs :
1717 tag :
2020 - uses : actions/checkout@v4
2121 with :
2222 fetch-depth : 0 # also fetch tags
23- - run : |
24- ELASTIC_APM_VERSION="v$(cat Gemfile | grep elastic-apm | awk 'BEGIN { FS=", " } { print $2 }' | tr -d \')"
25- # if the tag does not exist
26- if [[ ! $(git tag -l "${ELASTIC_APM_VERSION}") ]]; then
27- git tag ${ELASTIC_APM_VERSION}
28- git push origin "refs/tags/${ELASTIC_APM_VERSION}"
29- fi
23+
24+ - run : make create-release
25+ env :
26+ GH_TOKEN : ${{ secrets.CREATE_TAG_TOKEN }}
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ name: release
33on :
44 push :
55 branches : [ "main" ]
6- create :
76 tags : [ "v*" ]
87
98permissions :
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ PORT ?= 3000
22IMAGE ?= opbeans/opbeans-ruby
33VERSION ?= latest
44LTS_ALPINE ?= 12-alpine
5+ AGENT_VERSION =$(shell grep "elastic-apm" Gemfile | sed 's|.* , ||g' | tr -d \')
56
67.PHONY : help
78.DEFAULT_GOAL := help
@@ -35,3 +36,11 @@ publish: build ## Publish docker image
3536clean : # # Clean autogenerated files/folders
3637 @rm -rf bats
3738 @rm -rf target
39+
40+ create-release : # # Create github release given the APM Agent version if no tag release
41+ @if [ -z " $( shell git tag -l v$( AGENT_VERSION) ) " ]; then \
42+ echo " creating tag v$( AGENT_VERSION) " ; \
43+ gh release create " v$( AGENT_VERSION) " --title=" $( AGENT_VERSION) " --generate-notes; \
44+ else \
45+ echo " git tag v$( AGENT_VERSION) already exists" ; \
46+ fi
You can’t perform that action at this time.
0 commit comments