1111 required : true
1212 type : string
1313
14+ permissions :
15+ contents : write
16+ packages : write
17+ id-token : write
18+
1419env :
1520 REGISTRY : ghcr.io
1621 IMAGE_NAME : ${{ github.repository }}
4954 contents : write
5055 packages : write
5156 id-token : write
52-
57+
5358 steps :
5459 - name : Checkout code
5560 uses : actions/checkout@v4
@@ -92,66 +97,66 @@ jobs:
9297 run : |
9398 # Get the previous tag
9499 PREVIOUS_TAG=$(git describe --tags --abbrev=0 "${VERSION}^" 2>/dev/null || echo "")
95-
100+
96101 if [ -z "$PREVIOUS_TAG" ]; then
97102 echo "No previous tag found, including all commits"
98103 COMMIT_RANGE=""
99104 else
100105 echo "Generating changelog from $PREVIOUS_TAG to $VERSION"
101106 COMMIT_RANGE="$PREVIOUS_TAG..$VERSION"
102107 fi
103-
108+
104109 # Generate changelog
105110 {
106111 echo "CHANGELOG<<EOF"
107112 echo "## 🚀 What's Changed"
108113 echo ""
109-
114+
110115 # Features
111116 FEATURES=$(git log $COMMIT_RANGE --pretty=format:"* %s (%h)" --grep="^feat" 2>/dev/null)
112117 if [ -n "$FEATURES" ]; then
113118 echo "### ✨ Features"
114119 echo "$FEATURES"
115120 echo ""
116121 fi
117-
122+
118123 # Bug fixes
119124 FIXES=$(git log $COMMIT_RANGE --pretty=format:"* %s (%h)" --grep="^fix" 2>/dev/null)
120125 if [ -n "$FIXES" ]; then
121126 echo "### 🐛 Bug Fixes"
122127 echo "$FIXES"
123128 echo ""
124129 fi
125-
130+
126131 # Documentation
127132 DOCS=$(git log $COMMIT_RANGE --pretty=format:"* %s (%h)" --grep="^docs" 2>/dev/null)
128133 if [ -n "$DOCS" ]; then
129134 echo "### 📚 Documentation"
130135 echo "$DOCS"
131136 echo ""
132137 fi
133-
138+
134139 # Performance
135140 PERF=$(git log $COMMIT_RANGE --pretty=format:"* %s (%h)" --grep="^perf" 2>/dev/null)
136141 if [ -n "$PERF" ]; then
137142 echo "### ⚡ Performance"
138143 echo "$PERF"
139144 echo ""
140145 fi
141-
146+
142147 # All other commits
143148 OTHER=$(git log $COMMIT_RANGE --pretty=format:"* %s (%h)" --grep="^feat" --grep="^fix" --grep="^docs" --grep="^perf" --invert-grep 2>/dev/null)
144149 if [ -n "$OTHER" ]; then
145150 echo "### 🔧 Other Changes"
146151 echo "$OTHER"
147152 echo ""
148153 fi
149-
154+
150155 # Contributors
151156 echo "### 👥 Contributors"
152157 git log $COMMIT_RANGE --pretty=format:"* @%an" | sort -u
153158 echo ""
154-
159+
155160 # Statistics
156161 if [ -n "$COMMIT_RANGE" ]; then
157162 echo "### 📊 Statistics"
@@ -160,32 +165,34 @@ jobs:
160165 echo "* $COMMITS commits"
161166 echo "* $FILES"
162167 fi
163-
168+
164169 echo "EOF"
165170 } >> $GITHUB_OUTPUT
166171
167172 - name : Build and push with build.py
173+ env :
174+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
168175 run : |
169176 # Install Python dependencies for build script
170177 pip install rich click semver pyyaml
171-
178+
172179 # Set CI environment variable to ensure proper tagging
173180 export CI=true
174-
181+
175182 # Build and push with the specific version tag
176183 python build.py --version-tag ${{ steps.version.outputs.version_number }}
177-
184+
178185 # Additional tags for releases
179186 docker tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:v${{ steps.version.outputs.version_number }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
180187 docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
181-
188+
182189 # Create major and minor version tags
183190 MAJOR=$(echo ${{ steps.version.outputs.version_number }} | cut -d. -f1)
184191 MINOR=$(echo ${{ steps.version.outputs.version_number }} | cut -d. -f1,2)
185-
192+
186193 docker tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:v${{ steps.version.outputs.version_number }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:v${MAJOR}
187194 docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:v${MAJOR}
188-
195+
189196 docker tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:v${{ steps.version.outputs.version_number }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:v${MINOR}
190197 docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:v${MINOR}
191198
@@ -203,7 +210,7 @@ jobs:
203210 # Install cosign
204211 curl -sSL https://github.com/sigstore/cosign/releases/latest/download/cosign-linux-amd64 -o /tmp/cosign
205212 chmod +x /tmp/cosign
206-
213+
207214 # Sign the images
208215 /tmp/cosign sign --yes ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:v${{ steps.version.outputs.version_number }}
209216 /tmp/cosign sign --yes ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
@@ -221,32 +228,32 @@ jobs:
221228 sbom.spdx.json
222229 body : |
223230 ## 🐳 Docker Images
224-
231+
225232 ### Pull the image:
226233 ```bash
227234 # Latest version
228235 docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
229-
236+
230237 # Specific version
231238 docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}
232-
239+
233240 # Major version (will update with patches)
234241 docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:v$(echo ${{ steps.version.outputs.version_number }} | cut -d. -f1)
235242 ```
236-
243+
237244 ### Run the container:
238245 ```bash
239246 # Using docker-compose (recommended)
240247 docker-compose up -d
241-
248+
242249 # Or using docker run
243250 docker run -d \
244251 --name sensor-log-generator \
245252 -v $(pwd)/data:/app/data \
246253 -v $(pwd)/config:/app/config \
247254 ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}
248255 ```
249-
256+
250257 ### Run with WAL mode disabled (for Docker Desktop on Mac/Windows):
251258 ```bash
252259 docker run -d \
@@ -255,17 +262,17 @@ jobs:
255262 -e SENSOR_WAL=false \
256263 ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}
257264 ```
258-
265+
259266 ---
260-
267+
261268 ${{ steps.changelog.outputs.CHANGELOG }}
262-
269+
263270 ---
264-
271+
265272 ## 📦 Assets
266273 - **SBOM**: Software Bill of Materials attached below
267274 - **Container Signature**: Images are signed with Cosign/Sigstore
268-
275+
269276 ## 🔗 Quick Links
270277 - [Documentation](https://github.com/${{ github.repository }}/blob/main/README.md)
271278 - [Container Registry](https://github.com/${{ github.repository }}/pkgs/container/${{ github.event.repository.name }})
0 commit comments