Repository navigation
96 lines (86 loc) · 3.93 KB
/
Copy pathrelease.yml
File metadata and controls
96 lines (86 loc) · 3.93 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
name: Release
on:
push:
tags:
- 'v*' # Triggers on tags starting with 'v' (e.g., v1.0.0)
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write # Required for creating releases
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch full history for proper git log
- name: Create release directory
run: |
mkdir -p release
mkdir -p release/libs/rpda
mkdir -p release/example
- name: Copy files to release directory
run: |
cp ambient_auto_start.rpy release/
cp ambient_integration.rpy release/
cp dynamic_ambient.rpy release/
cp debug_ambient.rpy release/
cp audio_assets.yaml release/
cp arrangements.yaml release/
cp libs/rpda/02-rpda-cds.rpy release/libs/rpda/
cp LICENSE release/
cp README.md release/
cp -r example/RPDA_Demo_Project release/example/
- name: Create zip archive
run: |
cd release
zip -r ../RenPyDynamicAmbient-${{ github.ref_name }}.zip .
cd ..
- name: Get previous tag
id: prev_tag
run: |
PREV_TAG=$(git tag --sort=-version:refname | sed -n '2p')
if [ -z "$PREV_TAG" ]; then
echo "prev_tag=" >> $GITHUB_OUTPUT
else
echo "prev_tag=$PREV_TAG" >> $GITHUB_OUTPUT
fi
- name: Generate changelog
run: |
if [ -n "${{ steps.prev_tag.outputs.prev_tag }}" ]; then
echo "## 🔄 Changes since ${{ steps.prev_tag.outputs.prev_tag }}" > changelog.md
echo "" >> changelog.md
git log --pretty=format:"- %s (%h)" ${{ steps.prev_tag.outputs.prev_tag }}..${{ github.ref_name }} | head -20 >> changelog.md
else
echo "## 🎉 First release!" > changelog.md
echo "" >> changelog.md
echo "### All commits in this release:" >> changelog.md
git log --pretty=format:"- %s (%h)" | head -20 >> changelog.md
fi
echo "" >> changelog.md
echo "### 📦 Included files:" >> changelog.md
echo "- \`dynamic_ambient.rpy\` - main module" >> changelog.md
echo "- \`ambient_auto_start.rpy\` - auto-start ambient effects" >> changelog.md
echo "- \`ambient_integration.rpy\` - RenPy integration" >> changelog.md
echo "- \`debug_ambient.rpy\` - debug overlay" >> changelog.md
echo "- \`audio_assets.yaml\` - audio assets configuration" >> changelog.md
echo "- \`arrangements.yaml\` - arrangements configuration" >> changelog.md
echo "- \`libs/rpda/02-rpda-cds.rpy\` - CDS implementation" >> changelog.md
echo "- \`LICENSE\` - license file" >> changelog.md
echo "- \`README.md\` - documentation" >> changelog.md
echo "- \`example/RPDA_Demo_Project\` - example project" >> changelog.md
echo "" >> changelog.md
echo "### 🚀 Installation:" >> changelog.md
echo "1. Download the \`RenPyDynamicAmbient-${{ github.ref_name }}.zip\` archive" >> changelog.md
echo "2. Extract to the \`game/\` folder of your RenPy project" >> changelog.md
echo "3. Restart the game to apply changes" >> changelog.md
echo "" >> changelog.md
echo "### 📖 Documentation:" >> changelog.md
echo "Detailed documentation is available in the README.md file" >> changelog.md
- name: Create Release
uses: softprops/action-gh-release@v1
with:
name: "RenPy Dynamic Ambient ${{ github.ref_name }}"
body_path: changelog.md
files: RenPyDynamicAmbient-${{ github.ref_name }}.zip
draft: false
prerelease: ${{ contains(github.ref_name, 'alpha') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'rc') }}