-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.yml
More file actions
125 lines (109 loc) · 3.51 KB
/
action.yml
File metadata and controls
125 lines (109 loc) · 3.51 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
name: 📁 Setup C++ Plus Repository Utilities (Rubisco).
description: Setup Rubisco and add the command-line tools to the PATH.
author: The C++ Plus Project
inputs:
host:
description: Cross-compile to build programs to run on the host system.
required: true
outputs:
tag:
description: The tag of the repository for release build, if we are not in a release build, the tag will set to the current branch name.
value: ${{ steps.info.outputs.tag }}
reponame:
description: The name of the repository.
value: ${{ steps.info.outputs.reponame }}
pkgname:
description: The name of the package.
value: ${{ steps.info.outputs.pkgname }}
srcdir:
description: Source directory of the repository.
value: ${{ steps.info.outputs.srcdir }}
host:
description: Cross-compile to build programs to run on the host system.
value: ${{ inputs.host }}
runs:
using: composite
steps:
# Setup other utilities: curl, wget.
- name: 📁 Setup other utilities. (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt-get install curl wget -y
shell: pwsh
- name: 📁 Setup other utilities. (Windows)
if: runner.os == 'Windows'
run: |
choco install curl wget --yes
shell: pwsh
- name: 📁 Setup other utilities. (macOS)
if: runner.os == 'macOS'
run: |
brew install curl wget
shell: pwsh
# Setup Python.
- name: 📁 Setup Python.
uses: actions/setup-python@v5
with:
python-version: "3.13"
# Setup original C/C++ toolchain: llvm, clang, cmake, ninja.
- name: 📁 Setup C/C++ toolchain. (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get install llvm clang cmake ninja-build -y
shell: pwsh
- name: 📁 Setup C/C++ toolchain. (Windows)
if: runner.os == 'Windows'
run: |
choco install llvm ninja cmake --yes
shell: pwsh
- name: 📁 Setup C/C++ toolchain. (macOS)
if: runner.os == 'macOS'
run: |
brew install llvm ninja cmake
shell: pwsh
- name: 🧳 Setup MSVC. (Windows)
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v2
- name: 🧳 Setup XCode. (macOS)
if: runner.os == 'macOS'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: 🧳 Setup XMake.
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: latest
- name: 📁 Setup uv.
uses: astral-sh/setup-uv@v7
with:
version: "latest"
# Get repository infomation.
- name: 🏷️ Get repository infomation.
id: info
run: |
$tag="$env:GITHUB_REF_NAME"
if (-not $tag) {
$tag=$(git rev-parse --abbrev-ref HEAD)
}
$reponame=$env:GITHUB_REPOSITORY
try {
$reponame=$reponame.Split("/").Get(1)
}
catch {
Write-Host "Invalid repository name: '$reponame'." -ForegroundColor Red
}
Write-Output "tag=$tag" >> $env:GITHUB_OUTPUT
Write-Output "reponame=$reponame" >> $env:GITHUB_OUTPUT
Write-Output "pkgname=$reponame-$tag" >> $env:GITHUB_OUTPUT
Write-Output "srcdir=$PWD" >> $env:GITHUB_OUTPUT
shell: pwsh
# Build Rubisco.
- name: 📦 Build Rubisco.
run: |
$Env:RUBISCO_FRONTEND="nointeractive"
Set-Location "$env:GITHUB_ACTION_PATH"
pip install .
python -m rubisco build
pip install --upgrade pip
pip install dist/*.whl
shell: pwsh