Skip to content

Commit 47d649a

Browse files
authored
chore: release based on git tags (#85)
* chore: get version from tag if present * chore: push version based on tag * chore: remove version extraction and dispatch option * chore: remove version from input
1 parent bf982bd commit 47d649a

2 files changed

Lines changed: 4 additions & 24 deletions

File tree

.github/workflows/push.yaml

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,13 @@ on:
44
push:
55
branches:
66
- main
7-
- release-*
7+
tags:
8+
- 'v*'
89
pull_request: {}
9-
workflow_dispatch:
10-
inputs:
11-
version:
12-
description: Package version (e.g. v0.1.0)
13-
required: false
1410

1511
env:
1612
REGISTRY: ghcr.io
1713

18-
# The package version to push. The default is 0.0.0-gitsha.
19-
XPKG_VERSION: ${{ inputs.version }}
20-
2114
jobs:
2215
build:
2316
runs-on: ubuntu-24.04
@@ -41,14 +34,5 @@ jobs:
4134
username: ${{ github.actor }}
4235
password: ${{ secrets.GITHUB_TOKEN }}
4336

44-
# If a version wasn't explicitly passed as a workflow_dispatch input we
45-
# default to version v0.0.0-<git-commit-date>-<git-short-sha>, for example
46-
# v0.0.0-20231101115142-1091066df799. This is a simple implementation of
47-
# Go's pseudo-versions: https://go.dev/ref/mod#pseudo-versions.
48-
- name: Set Default Multi-Platform Package Version
49-
if: env.XPKG_VERSION == ''
50-
run: echo "XPKG_VERSION=v0.0.0-$(date -d@$(git show -s --format=%ct) +%Y%m%d%H%M%S)-$(git rev-parse --short=12 HEAD)" >> $GITHUB_ENV
51-
5237
- name: Push xpkg
53-
if: env.XPKG_VERSION != ''
5438
run: make push

Makefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
LIBRARY_VERSION:=0.16.0
21
PROVIDER_VERSION:=0.40.0
3-
XPKG_VERSION?=$(LIBRARY_VERSION)-$(PROVIDER_VERSION)
42
JSONNET_BIN:=jrsonnet
53
CROSSPLANE?=crossplane
64
REGISTRY?=ghcr.io
75
SHELL:=/bin/bash
86

7+
XPKG_VERSION?=$(shell git describe --tags)
8+
99
GENERATOR_DEPTHS:=$(shell find generator -type f)
1010

1111
.PHONY: build
@@ -51,10 +51,6 @@ docs: $(shell find grafanaplane/ -type f)
5151
-S -c -m docs \
5252
-e '(import "github.com/jsonnet-libs/docsonnet/doc-util/main.libsonnet").render(import "grafanaplane/main.libsonnet")'
5353

54-
.PHONY: tag
55-
tag:
56-
git tag $(LIBRARY_VERSION)-$(PROVIDER_VERSION)
57-
5854
.PHONY: fmt
5955
fmt:
6056
@find . \

0 commit comments

Comments
 (0)