-
Notifications
You must be signed in to change notification settings - Fork 39
130 lines (108 loc) · 3.44 KB
/
release.yml
File metadata and controls
130 lines (108 loc) · 3.44 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Build and Release
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: lute-linux-x86_64
options: --c-compiler=clang --cxx-compiler=clang++
- os: ubuntu-24.04-arm
artifact_name: lute-linux-aarch64
options: --c-compiler=clang --cxx-compiler=clang++
- os: macos-latest
artifact_name: lute-macos-aarch64
- os: windows-latest
artifact_name: lute-windows-x86_64
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y ninja-build clang
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew update
brew install cmake ninja
- name: Install dependencies (Windows)
if: runner.os == 'Windows'
run: |
choco install ninja
- if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
- name: Configure
run: python ./tools/luthier.py configure lute --config release ${{ matrix.options }}
- name: Build
run: python ./tools/luthier.py build lute --config release ${{ matrix.options }}
- name: Get Artifact Path
id: artifact_path
shell: bash
run: |
exe_path=$(python ./tools/luthier.py build lute --config release --which)
echo "Executable path: $exe_path" # Debug print
echo "exe_path=$exe_path" >> "$GITHUB_OUTPUT"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
path: ${{ steps.artifact_path.outputs.exe_path }}
name: ${{ matrix.artifact_name }}
release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
sparse-checkout: get_version.cmake
- name: Download Artifact
uses: actions/download-artifact@v4
with:
path: artifacts
- run: |
mkdir release
for dir in ./artifacts/*; do
base_name=$(basename "$dir")
zip -rj release/"${base_name}.zip" "$dir"/*
done
- name: Get project version
id: get_version
run: |
VERSION=$(cmake -P get_version.cmake 2>&1)
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Create Nightly Tag
id: tag_step
if: github.event_name == 'schedule'
run: |
DATE=$(date +%Y%m%d)
TAG="-nightly.$DATE"
echo "tag=$TAG" >> $GITHUB_OUTPUT
- name: Create Release Tag
id: tag_release
run: |
VERSION=${{ steps.get_version.outputs.version }}
NIGHTLY_TAG=${{ steps.tag_step.outputs.tag }}
RELEASE_TAG="$VERSION$NIGHTLY_TAG"
echo "tag=$RELEASE_TAG" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag_release.outputs.tag }}
name: ${{ steps.tag_release.outputs.tag }}
draft: false
prerelease: ${{ github.event_name == 'schedule' }}
files: release/*.zip