-
Notifications
You must be signed in to change notification settings - Fork 9
124 lines (106 loc) · 3.89 KB
/
release.yml
File metadata and controls
124 lines (106 loc) · 3.89 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: 🎼 Release Code Conductor
on:
push:
tags:
- 'v*'
permissions:
contents: write
packages: write
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install pyyaml requests
- name: Validate configuration
run: |
python .conductor/scripts/validate-config.py
- name: Get version from tag
id: version
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag_name=v$VERSION" >> $GITHUB_OUTPUT
- name: Verify VERSION file matches tag
run: |
FILE_VERSION=$(cat VERSION)
TAG_VERSION="${{ steps.version.outputs.version }}"
if [ "$FILE_VERSION" != "$TAG_VERSION" ]; then
echo "VERSION file ($FILE_VERSION) doesn't match tag ($TAG_VERSION)"
exit 1
fi
- name: Create release archive
run: |
# Create code-conductor template archive
mkdir -p dist
# Include core template files
tar -czf dist/code-conductor-template-${{ steps.version.outputs.version }}.tar.gz \
.conductor/ \
examples/ \
docs/ \
setup.py \
install.sh \
README.md \
CHANGELOG.md \
VERSION \
.gitignore
# Create quick-start zip for GitHub releases
zip -r dist/code-conductor-${{ steps.version.outputs.version }}.zip \
.conductor/ \
examples/ \
docs/ \
setup.py \
install.sh \
README.md \
CHANGELOG.md \
VERSION \
.gitignore
- name: Extract changelog for this version
id: changelog
run: |
# Extract changelog section for this version
VERSION="${{ steps.version.outputs.version }}"
# Get content between this version and next version/unreleased
awk "/## \[$VERSION\]/{flag=1;next}/## \[/{flag=0}flag" CHANGELOG.md > release_notes.md
# If no specific changelog found, use generic message
if [ ! -s release_notes.md ]; then
echo "Release $VERSION" > release_notes.md
echo "" >> release_notes.md
echo "See CHANGELOG.md for details." >> release_notes.md
fi
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.version.outputs.tag_name }}
name: 🎼 Code Conductor ${{ steps.version.outputs.version }}
body_path: release_notes.md
draft: false
prerelease: false
files: |
dist/code-conductor-template-${{ steps.version.outputs.version }}.tar.gz
dist/code-conductor-${{ steps.version.outputs.version }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update installation URLs
run: |
echo "🎉 Release ${{ steps.version.outputs.version }} created!"
echo ""
echo "📦 Assets:"
echo "- Template: code-conductor-template-${{ steps.version.outputs.version }}.tar.gz"
echo "- Quick-start: code-conductor-${{ steps.version.outputs.version }}.zip"
echo ""
echo "🚀 Installation:"
echo "curl -sSL https://github.com/ryanmac/code-conductor/releases/download/${{ steps.version.outputs.tag_name }}/install.sh | bash"
echo ""
echo "📚 Documentation: https://github.com/ryanmac/code-conductor/blob/main/docs/USAGE.md"