Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions .github/workflows/create-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,16 @@ on:
- .version

permissions:
contents: write
contents: read

jobs:
tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create release
run: |
APM_AGENT_JAVA_VERSION="v$(cat .version)"
gh release create "${APM_AGENT_JAVA_VERSION}" \
--title="${APM_AGENT_JAVA_VERSION}" \
--generate-notes
with:
fetch-depth: 0 # also fetch tags

- run: make create-release
env:
GH_TOKEN: ${{ github.token }}

GH_TOKEN: ${{ secrets.CREATE_TAG_TOKEN }}
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: release
on:
push:
branches: [ "main" ]
create:
tags: [ "v*" ]

permissions:
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ PORT ?= 8000
IMAGE ?= opbeans/opbeans-java
VERSION ?= latest
LTS_ALPINE ?= 12-alpine
AGENT_VERSION=$(shell cat .version)

.PHONY: help
.DEFAULT_GOAL := help
Expand Down Expand Up @@ -35,3 +36,11 @@ publish: build ## Publish docker image
clean: ## Clean autogenerated files/folders
@rm -rf bats
@rm -rf target

create-release: ## Create git tag given the APM Agent version
@if [ -z "$(shell git tag -l v$(AGENT_VERSION))" ]; then \
echo "creating tag v$(AGENT_VERSION)"; \
gh release create "v$(AGENT_VERSION)" --title="$(AGENT_VERSION)" --generate-notes; \
else \
echo "git tag v$(AGENT_VERSION) already exists"; \
fi