-
-
Notifications
You must be signed in to change notification settings - Fork 53
83 lines (77 loc) · 4.36 KB
/
Copy pathgithub-release.yml
File metadata and controls
83 lines (77 loc) · 4.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# GitHub Release Workflow Example
# Copy this file to .github/workflows/ in your repository and configure as needed.
# Configure GitHub Variables for organization-wide settings (see documentation).
# Current Version: https://github.com/owndev-public/workflows/blob/main/examples/github-release.yml
#
# QUICK START:
# 1. Configure GitHub Variables for your release settings (see documentation)
# 2. Push to main/master branches or create tags to trigger releases
# 3. Workflow automatically uses GitVersion for semantic versioning
# 4. Environment-aware releases (Development/Staging/Production)
#
# AI RELEASE NOTES (optional):
# 1. Set RELEASE_AI_ENABLED = "true" (GitHub Variable)
# 2. The 'copilot-requests: write' permission below is what entitles the Copilot CLI.
# GITHUB_TOKEN is sufficient; a RELEASE_AI_TOKEN secret is optional and needs no scope.
# Note: Organization-scoped PATs do NOT work (403) — only personal PATs or GITHUB_TOKEN
# The organisation must also allow "use of Copilot CLI billed to the organization".
# 3. Create "Release-Review" GitHub Environment with Required Reviewers
# 4. Optionally configure: RELEASE_AI_MODEL, RELEASE_AI_LANGUAGE
# Leave RELEASE_AI_MODEL unset to follow the Copilot account default (recommended) — a pinned
# model id stops working the day GitHub retires it from the Copilot CLI catalogue
# See: https://github.com/owndev-public/workflows/blob/main/README.md
#
# FEATURES: GitVersion integration, Environment support, Automatic versioning,
# AI-generated release notes (optional), Review approval workflow
name: 🏷️ GitHub Release
permissions:
contents: write
actions: read
discussions: write
# actions/ai-inference v3 reaches the model through the GitHub Copilot CLI, which is entitled by
# `copilot-requests: write`. The former `models: read` addressed GitHub Models, retired 2026-07-30.
# It has to be granted HERE: a called workflow can only downgrade the caller's GITHUB_TOKEN, never
# elevate it. Keeping `models: read` fails the run before the first step with
# "The workflow is requesting 'models: read', but is only allowed 'models: none'".
copilot-requests: write
# Prevent concurrent runs on same ref
concurrency:
group: github-release-${{ github.ref }}
cancel-in-progress: true
on:
push:
tags: ["v*"] # Trigger on version tags (e.g., v1.0.0)
# branches: ["release/**", "dev", "develop"]
# All shared configuration is handled via GitHub Variables
workflow_dispatch:
# https://github.com/owndev-public/workflows/tree/main/.github/workflows/github-release.yml
jobs:
# Create GitHub Release with GitVersion and Environment support
# Optional: AI-generated release notes with review approval
create-release:
name: 🏷️ Create GitHub Release
uses: owndev-public/workflows/.github/workflows/github-release.yml@main
with:
release_github_use_gitversion: ${{ vars.RELEASE_GITHUB_USE_GITVERSION }}
gitversion_version_spec: ${{ vars.GITVERSION_VERSION_SPEC }}
release_github_tag_name: ${{ vars.RELEASE_GITHUB_TAG_NAME }}
release_github_name: ${{ vars.RELEASE_GITHUB_NAME }}
release_github_draft: ${{ vars.RELEASE_GITHUB_DRAFT }}
release_github_generate_notes: ${{ vars.RELEASE_GITHUB_GENERATE_NOTES }}
release_github_append_body: ${{ vars.RELEASE_GITHUB_APPEND_BODY }}
release_github_artifact_pattern: ${{ vars.RELEASE_GITHUB_ARTIFACT_PATTERN }}
release_github_artifact_path: ${{ vars.RELEASE_GITHUB_ARTIFACT_PATH }}
release_github_files_pattern: ${{ vars.RELEASE_GITHUB_FILES_PATTERN }}
release_github_environment_url: ${{ vars.RELEASE_GITHUB_ENVIRONMENT_URL }}
release_github_custom_body: ${{ vars.RELEASE_GITHUB_CUSTOM_BODY }}
release_github_discussion_enabled: ${{ vars.RELEASE_GITHUB_DISCUSSION_ENABLED }}
release_github_discussion_category: ${{ vars.RELEASE_GITHUB_DISCUSSION_CATEGORY }}
release_ai_enabled: ${{ vars.RELEASE_AI_ENABLED }}
release_ai_model: ${{ vars.RELEASE_AI_MODEL }}
release_ai_language: ${{ vars.RELEASE_AI_LANGUAGE }}
release_ai_custom_prompt: ${{ vars.RELEASE_AI_CUSTOM_PROMPT }}
release_ai_project_description: ${{ vars.RELEASE_AI_PROJECT_DESCRIPTION }}
release_ai_max_commits: ${{ vars.RELEASE_AI_MAX_COMMITS }}
release_ai_review_environment: ${{ vars.RELEASE_AI_REVIEW_ENVIRONMENT }}
secrets:
release_ai_token: ${{ secrets.RELEASE_AI_TOKEN }}