4 Commits

Author SHA1 Message Date
Adam Nadrowski
75506536fa Merge pull request #3 from shadyeip/ci/auto-release-on-main
ci: auto-release with date-based versioning on merge to main
2026-02-09 12:48:03 -05:00
Adam Nadrowski
a65f546776 ci: auto-release with date-based versioning on merge to main
Release workflow now triggers on push to main and auto-generates
date-based version tags (v2026.02.09, v2026.02.09.1, etc.).
Manual dispatch and explicit v* tags still work.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 12:47:36 -05:00
Adam Nadrowski
a9d8e8005e Merge pull request #2 from shadyeip/ci/improve-workflows
ci: restrict acceptance tests to manual dispatch only
2026-02-09 12:43:56 -05:00
Adam Nadrowski
d9f0c626d5 Merge pull request #1 from shadyeip/ci/improve-workflows
ci: add PR validation and fix workflows for go-unifi dependency
2026-02-09 12:41:07 -05:00

View File

@@ -2,13 +2,15 @@ name: release
on: on:
push: push:
branches:
- main
tags: tags:
- "v*" - "v*"
workflow_dispatch: workflow_dispatch:
inputs: inputs:
tag: tag:
description: "Version tag to release (e.g. v1.0.0)" description: "Version tag to release (e.g. v2026.02.09)"
required: true required: false
type: string type: string
jobs: jobs:
@@ -40,17 +42,28 @@ jobs:
id: version id: version
working-directory: terraform-provider-unifi working-directory: terraform-provider-unifi
run: | run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then if [ -n "${{ inputs.tag }}" ]; then
echo "tag=${{ inputs.tag }}" >> "$GITHUB_OUTPUT" TAG="${{ inputs.tag }}"
elif [[ "$GITHUB_REF" == refs/tags/* ]]; then
TAG="${GITHUB_REF#refs/tags/}"
else else
echo "tag=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT" # Date-based version: v2026.02.09, v2026.02.09.1, v2026.02.09.2, ...
DATE_TAG="v$(date -u +'%Y.%m.%d')"
SUFFIX=0
TAG="$DATE_TAG"
while git rev-parse "$TAG" >/dev/null 2>&1; do
SUFFIX=$((SUFFIX + 1))
TAG="${DATE_TAG}.${SUFFIX}"
done
fi fi
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
- name: Create tag (workflow_dispatch only) - name: Create and push tag
if: github.event_name == 'workflow_dispatch' if: ${{ !startsWith(github.ref, 'refs/tags/') }}
working-directory: terraform-provider-unifi working-directory: terraform-provider-unifi
run: | run: |
git tag "${{ steps.version.outputs.tag }}" git tag "${{ steps.version.outputs.tag }}"
git push origin "${{ steps.version.outputs.tag }}"
- name: Import GPG key - name: Import GPG key
if: env.GPG_PRIVATE_KEY != '' if: env.GPG_PRIVATE_KEY != ''