Skip to content

Commit 3862c1d

Browse files
committed
feat: Add automated release workflow
- Automatically generates changelogs - Creates releases on tag push - Runs shellcheck before release - Includes comprehensive release notes
1 parent 9000148 commit 3862c1d

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

.github/workflows/release.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Get version from tag
19+
id: tag_version
20+
run: |
21+
echo "TAG_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
22+
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
23+
24+
- name: Generate changelog
25+
id: changelog
26+
run: |
27+
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
28+
if [ -z "$PREVIOUS_TAG" ]; then
29+
git log --pretty=format:"* %s (%h)" > CHANGELOG.md
30+
else
31+
git log --pretty=format:"* %s (%h)" $PREVIOUS_TAG..HEAD > CHANGELOG.md
32+
fi
33+
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
34+
cat CHANGELOG.md >> $GITHUB_ENV
35+
echo "EOF" >> $GITHUB_ENV
36+
37+
- name: Run ShellCheck
38+
uses: ludeeus/action-shellcheck@master
39+
with:
40+
scandir: '.'
41+
severity: error
42+
43+
- name: Create Release
44+
uses: softprops/action-gh-release@v1
45+
with:
46+
name: Docker Safe Shutdown ${{ env.TAG_VERSION }}
47+
body: |
48+
# Docker Safe Shutdown ${{ env.TAG_VERSION }}
49+
50+
## Changes in this Release
51+
${{ env.CHANGELOG }}
52+
53+
## Features
54+
- Safe Docker container shutdown with proper cleanup
55+
- Automatic container startup on system boot
56+
- Detailed logging system
57+
- Error handling and recovery
58+
- GitHub Actions CI integration
59+
60+
## Installation
61+
```bash
62+
git clone https://github.com/PeterVinter/docker-safe-shutdown.git
63+
cd docker-safe-shutdown
64+
chmod +x *.sh
65+
```
66+
67+
## Requirements
68+
- Docker installed and running
69+
- Linux operating system
70+
- Root or sudo privileges
71+
draft: false
72+
prerelease: false
73+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)