-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (77 loc) · 2.87 KB
/
release.yml
File metadata and controls
100 lines (77 loc) · 2.87 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
name: Release
on:
push:
tags:
- 'v*.*.*'
env:
REGISTRY: ghcr.io
IMAGE_PREFIX: ${{ github.repository }}
jobs:
create-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate changelog
id: changelog
run: |
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
if [ -z "$PREV_TAG" ]; then
CHANGELOG=$(git log --pretty=format:"- %s (%h)" --no-merges)
else
CHANGELOG=$(git log ${PREV_TAG}..HEAD --pretty=format:"- %s (%h)" --no-merges)
fi
echo "$CHANGELOG" > CHANGELOG.txt
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
body: |
## Changes in this Release
${{ steps.changelog.outputs.changelog }}
## Installation
See [README.md](README.md) for installation instructions.
### Quick Start with Docker Compose
```bash
git clone https://github.com/${{ github.repository }}.git
cd $(basename ${{ github.repository }})
git checkout ${{ github.ref_name }}
cp .env.example .env
# Edit .env with your configuration
docker compose up -d
```
draft: false
prerelease: ${{ contains(github.ref_name, 'rc') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'alpha') }}
generate_release_notes: true
files: |
CHANGELOG.txt
docker-compose.yml
.env.example
build-release-artifacts:
runs-on: ubuntu-latest
needs: create-release
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create release artifacts
run: |
mkdir -p release
cp -r infrastructure release/ 2>/dev/null || echo "No infrastructure directory"
cp docker-compose.yml release/ 2>/dev/null || echo "No docker-compose.yml"
cp .env.example release/ 2>/dev/null || echo "No .env.example"
cp README.md release/ 2>/dev/null || echo "No README.md"
cp LICENSE release/ 2>/dev/null || echo "No LICENSE"
cp LICENSE-MIT release/ 2>/dev/null || echo "No LICENSE-MIT"
cp LICENSE-APACHE release/ 2>/dev/null || echo "No LICENSE-APACHE"
cp README_EN.md release/ 2>/dev/null || echo "No README_EN.md"
tar -czf linx-${{ github.ref_name }}.tar.gz release/
- name: Upload release artifacts
uses: softprops/action-gh-release@v1
with:
files: linx-${{ github.ref_name }}.tar.gz