Skip to content

Commit

Permalink
faster
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v committed Apr 30, 2024
1 parent d518161 commit 0d69d1a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/create-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,10 @@ jobs:
with:
# This should help with running GitHub events
token: ${{ secrets.CREATE_TAG_TOKEN }}

- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies # This is needed to be able to run the npm list command
run: npm ci
- run: |
ELASTIC_APM_NODE_VERSION=$(npm list --depth 0 --json elastic-apm-node | jq -r '.dependencies."elastic-apm-node".version')
ELASTIC_APM_NODE_VERSION_WITH_PREFIX="v${ELASTIC_APM_NODE_VERSION}"
# if the tag does not exist
if [[ ! $(git tag -l "${ELASTIC_APM_NODE_VERSION_WITH_PREFIX}") ]]; then
git tag ${ELASTIC_APM_NODE_VERSION_WITH_PREFIX}
git push origin "refs/tags/${ELASTIC_APM_NODE_VERSION_WITH_PREFIX}"
fi

- run: make create-tag
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ PORT ?= 3000
IMAGE ?= opbeans/opbeans-node
VERSION ?= latest
LTS_ALPINE ?= 20-alpine
AGENT_VERSION=v$(shell npm ls --package-lock-only elastic-apm-node --json | jq -r '.dependencies."elastic-apm-node".version')

.DEFAULT_GOAL := help

Expand Down Expand Up @@ -34,3 +35,12 @@ publish: build ## Publish docker image
clean: ## Clean autogenerated files/folders
@rm -rf bats
@rm -rf target

create-tag: ## Create git tag given the APM Agent version
@if [ -z "$(shell git tag -l "$(AGENT_VERSION)")" ]; then \
echo "creating tag $(AGENT_VERSION)"; \
git tag $(AGENT_VERSION); \
git push origin "refs/tags/$(AGENT_VERSION)"; \
else \
echo "git tag $(AGENT_VERSION) already exists"; \
fi

0 comments on commit 0d69d1a

Please sign in to comment.