-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (59 loc) · 1.77 KB
/
release.yml
File metadata and controls
68 lines (59 loc) · 1.77 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
name: Build and Release CTERMUI
on:
push:
branches: [main]
tags: ['*']
release:
types: [created]
jobs:
build:
name: Build on Linux
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up build tools
run: |
sudo apt-get update || true
sudo apt-get install -y build-essential cmake || true
- name: Build static and shared library (Make)
run: |
make clean || true
make static || true
make shared || true
shell: bash
continue-on-error: true
- name: Find built artifacts
id: find_artifacts
run: |
STATIC=$(find . -name '*.a' | head -n 1)
SHARED=$(find . -name '*.so' | head -n 1)
echo "static=$STATIC" >> $GITHUB_OUTPUT
echo "shared=$SHARED" >> $GITHUB_OUTPUT
shell: bash
- name: Upload static library artifact
if: steps.find_artifacts.outputs.static != ''
uses: actions/upload-artifact@v4
with:
name: ctermui-static-linux
path: ${{ steps.find_artifacts.outputs.static }}
- name: Upload shared library artifact
if: steps.find_artifacts.outputs.shared != ''
uses: actions/upload-artifact@v4
with:
name: ctermui-shared-linux
path: ${{ steps.find_artifacts.outputs.shared }}
release:
name: Attach Artifacts to Release
needs: build
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v3
with:
path: ./artifacts
- name: Upload release assets
uses: softprops/action-gh-release@v1
with:
files: ./artifacts/**/*