-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (54 loc) · 1.56 KB
/
Copy pathbuild-release.yml
File metadata and controls
67 lines (54 loc) · 1.56 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
name: build-release
on:
push:
branches:
- main
- master
tags:
- "v*"
pull_request:
workflow_dispatch:
permissions:
contents: write
jobs:
package-macos:
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure
run: cmake -S . -B build
- name: Build
run: cmake --build build -j4
- name: Test
run: ctest --test-dir build --output-on-failure
- name: Install Staging
run: cmake --install build --prefix "$GITHUB_WORKSPACE/dist/install"
- name: Package
run: cpack --config build/CPackConfig.cmake
- name: Create Source Archive
if: startsWith(github.ref, 'refs/tags/v')
run: |
VERSION="${GITHUB_REF_NAME#v}"
git archive --format=tar.gz --prefix="mtop-${VERSION}/" "$GITHUB_REF_NAME" > "mtop-${VERSION}-source.tar.gz"
- name: Collect Artifacts
run: |
mkdir -p dist/artifacts
shopt -s nullglob
for file in mtop-*.tar.gz; do
mv "$file" dist/artifacts/
done
find dist -maxdepth 3 -type f | sort
- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: mtop-macos-package
path: |
dist/artifacts/*
dist/install/**
- name: Publish GitHub Release Assets
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: dist/artifacts/*