6 Commits

Author SHA1 Message Date
benvin 4dcb3ac71a Merge pull request 'fix: escape shell variables in release pipeline' (#7) from benvin/fix-release-vars into main
ci/woodpecker/tag/release Pipeline was successful
Reviewed-on: #7
2026-06-23 00:42:40 +10:00
unkinben eeb4a60639 fix: escape shell variables in release pipeline
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
Woodpecker interpolates ${VERSION} as a CI variable (empty) before the
shell sees it. Use $$ escaping so the shell assignment and references
survive YAML interpolation.
2026-06-23 00:39:21 +10:00
benvin 41ef83ba34 Merge pull request 'fix: use python3 zipfile instead of zip binary' (#6) from benvin/fix-zip-packaging into main
ci/woodpecker/tag/release Pipeline failed
Reviewed-on: #6
2026-06-23 00:35:50 +10:00
unkinben 3d5154a12a fix: use python3 zipfile instead of zip binary for packaging
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
The almalinux9-gobuilder image doesn't have the zip binary and dnf
install is unreliable in CI. python3 is always available.
2026-06-23 00:31:53 +10:00
benvin ec9f7d410f Merge pull request 'feat: add zip packaging target and woodpecker release pipeline' (#5) from benvin/makefile-ci-upload into main
ci/woodpecker/tag/release Pipeline failed
Reviewed-on: #5
2026-06-23 00:21:30 +10:00
unkinben 03b3344d8f feat: add zip packaging target and woodpecker release pipeline
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
2026-06-23 00:18:06 +10:00
2 changed files with 27 additions and 2 deletions
+19
View File
@@ -0,0 +1,19 @@
when:
- event: tag
steps:
- name: package
image: git.unkin.net/unkin/almalinux9-gobuilder:20260606
commands:
- make package VERSION=${CI_COMMIT_TAG}
- name: upload
image: git.unkin.net/unkin/almalinux9-base:20260606
commands:
- |
VERSION=$$(echo ${CI_COMMIT_TAG} | sed 's/^v//')
FILE="terraform-provider-artifactapi_$${VERSION}_linux_amd64.zip"
curl -f -X PUT \
"https://artifactapi3.k8s.syd1.au.unkin.net/api/v2/remotes/terraform-unkin/files/unkin/artifactapi/$${FILE}" \
-H "Content-Type: application/zip" \
--data-binary @"$${FILE}"
+8 -2
View File
@@ -1,10 +1,11 @@
.PHONY: build install test lint fmt clean tidy patch minor major
.PHONY: build install test lint fmt clean tidy patch minor major package
BINARY := terraform-provider-artifactapi
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "0.0.0-dev")
OS_ARCH := linux_amd64
INSTALL_VERSION := $(shell echo $(VERSION) | sed 's/^v//')
INSTALL_DIR := ~/.terraform.d/plugins/git.unkin.net/unkin/artifactapi/$(INSTALL_VERSION)/$(OS_ARCH)
ZIP := $(BINARY)_$(INSTALL_VERSION)_$(OS_ARCH).zip
GO_VERSION_REQUIRED := 1.23
GO_VERSION_ACTUAL := $(shell go version | sed 's/go version go\([0-9]*\.[0-9]*\).*/\1/')
@@ -30,8 +31,13 @@ lint: check-go
fmt: check-go
gofmt -w .
package: build
cp $(BINARY) $(BINARY)_v$(INSTALL_VERSION)
python3 -c "import zipfile,sys; z=zipfile.ZipFile(sys.argv[1],'w',zipfile.ZIP_DEFLATED); z.write(sys.argv[2]); z.close()" $(ZIP) $(BINARY)_v$(INSTALL_VERSION)
rm $(BINARY)_v$(INSTALL_VERSION)
clean:
rm -f $(BINARY)
rm -f $(BINARY) *.zip
tidy:
go mod tidy