forked from ArnesSI/netbox-inventory
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (54 loc) · 1.61 KB
/
release.yml
File metadata and controls
66 lines (54 loc) · 1.61 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
name: Build and Release
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
name: Build Package
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: pip install --upgrade setuptools wheel build
- name: Build the package
run: python -m build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
release:
name: Release Package
needs: build
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Debug artifact contents
run: ls -l dist/
- name: Create GitHub Release
run: |
echo "Finding version from dist/ filename..."
VERSION="v$(ls dist/netbox_inventory_plus-*.tar.gz | sed -E 's/.*netbox_inventory_plus-([0-9.]+)\.tar\.gz/\1/')"
echo "Extracted version: $VERSION"
gh release create "$VERSION" dist/netbox_inventory_plus-*.tar.gz dist/netbox_inventory_plus-*.whl \
--title "NetBox Inventory Plus $VERSION" \
--notes "Release $VERSION"
- name: Clean up
run: |
echo "Cleaning up..."
rm -rf dist
echo "Cleanup complete."