-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (55 loc) · 1.9 KB
/
Copy pathrelease.yml
File metadata and controls
63 lines (55 loc) · 1.9 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
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
version:
description: "Version to release (e.g., v1.0.0)"
required: true
type: string
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Determine version
id: version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
VERSION="${{ inputs.version }}"
else
VERSION="${GITHUB_REF#refs/tags/}"
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Create tag (manual dispatch only)
if: github.event_name == 'workflow_dispatch'
run: |
git tag ${{ steps.version.outputs.version }}
git push origin ${{ steps.version.outputs.version }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.version }}
name: ${{ steps.version.outputs.version }}
generate_release_notes: true
body: |
## Usage
```yaml
# For PR close tracking
- uses: acunniffe/git-ai-action/pr-close@${{ steps.version.outputs.version }}
with:
git-ai-version: "v1.0.23" # Pin to a specific git-ai version
github-token: ${{ secrets.GITHUB_TOKEN }}
pr-url: ${{ github.event.pull_request.html_url }}
merge-commit-sha: ${{ github.event.pull_request.merge_commit_sha }}
# For daily metrics
- uses: acunniffe/git-ai-action/daily-metrics@${{ steps.version.outputs.version }}
with:
git-ai-version: "v1.0.23" # Pin to a specific git-ai version
default-branch: ${{ github.event.repository.default_branch }}
```