forked from lyarinet/Samba-Manager
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (67 loc) · 2.05 KB
/
Copy pathrelease.yml
File metadata and controls
80 lines (67 loc) · 2.05 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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
run: |
python -c "
import sys
sys.path.insert(0, '.')
from app import create_app
app = create_app()
print('App created successfully for release')
"
- name: Create release archive
run: |
# Create a clean archive without venv and logs
tar -czf samba-manager-${{ github.ref_name }}.tar.gz \
--exclude='venv' \
--exclude='logs' \
--exclude='__pycache__' \
--exclude='.git' \
--exclude='.github' \
--exclude='*.pyc' \
--exclude='.pytest_cache' \
.
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
## Samba Manager ${{ github.ref_name }}
### Changes
- Automated release created from tag ${{ github.ref_name }}
### Installation
Download the `samba-manager-${{ github.ref_name }}.tar.gz` file and follow the installation instructions in the README.
### What's New
See RELEASE_NOTES.md for detailed changes.
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./samba-manager-${{ github.ref_name }}.tar.gz
asset_name: samba-manager-${{ github.ref_name }}.tar.gz
asset_content_type: application/gzip