-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (80 loc) · 2.4 KB
/
Copy pathrelease.yml
File metadata and controls
95 lines (80 loc) · 2.4 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
name: release
on:
push:
tags:
- 'v*'
jobs:
build-wheel-linux:
name: build linux x86_64 wheel
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: install build deps
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential
pip install build
- name: build liblecerf.so
run: |
cmake -B build_release \
-DCMAKE_BUILD_TYPE=Release \
-DLECERF_BUILD_PYTHON=ON
cmake --build build_release --target liblecerf -j$(nproc)
test -f build_release/liblecerf.so
cp build_release/liblecerf.so python/lecerf/liblecerf.so
- name: build wheel
working-directory: python
run: python -m build --wheel
- uses: actions/upload-artifact@v4
with:
name: wheels
path: python/dist/*.whl
if-no-files-found: error
build-and-push-docker:
name: build + push ghcr.io image
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: lowercase repo owner
id: owner
run: echo "name=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT"
- uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
push: true
tags: |
ghcr.io/${{ steps.owner.outputs.name }}/lecerf:latest
ghcr.io/${{ steps.owner.outputs.name }}/lecerf:${{ github.ref_name }}
cache-from: type=gha
cache-to: type=gha,mode=max
release:
name: cut github release
needs: [build-wheel-linux, build-and-push-docker]
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
name: wheels
path: dist/
- name: list artifacts
run: ls -la dist/
- uses: softprops/action-gh-release@v2
with:
files: dist/*.whl
generate_release_notes: true
fail_on_unmatched_files: true