Skip to content
This repository was archived by the owner on Mar 12, 2026. It is now read-only.

Commit da6e353

Browse files
authored
chore: fix asf header (#44)
* chore: fix asf header * fix ci * add rust toolchain * fix clippy * add release yml * delete lock * build universal2-apple-darwin * bump version
1 parent f50d44d commit da6e353

21 files changed

+931
-779
lines changed

.asf.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# "License"); you may not use this file except in compliance
77
# with the License. You may obtain a copy of the License at
88
#
9-
# http://www.apache.org/licenses/LICENSE-2.0
9+
# http://www.apache.org/licenses/LICENSE-2.0
1010
#
1111
# Unless required by applicable law or agreed to in writing,
1212
# software distributed under the License is distributed on an

.github/workflows/ci.yml

Lines changed: 33 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
1-
# Copyright 2022 HoraeDB Project Authors. Licensed under Apache-2.0.
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
217

318
name: CI
419

@@ -20,73 +35,29 @@ env:
2035
CARGO_TERM_COLOR: always
2136

2237
jobs:
23-
style-check:
24-
name: Libraries Style Check
38+
lint:
39+
name: Lint
2540
runs-on: ubuntu-latest
2641
timeout-minutes: 20
2742
strategy:
2843
matrix:
29-
rust: [1.62.0]
30-
container:
31-
image: rust:${{ matrix.rust }}-slim-bullseye
44+
rust: [stable]
3245
steps:
33-
- uses: actions/checkout@v3
34-
- name: Setup Build Environment
35-
run: |
36-
apt update
37-
apt install --yes cmake
38-
rm -rf /var/lib/apt/lists/*
39-
- name: Setup Toolchain
40-
run: |
41-
rustup component add rustfmt
42-
- name: Run
43-
run: |
44-
make fmt
45-
env:
46-
CARGO_HOME: "/github/home/.cargo"
47-
CARGO_TARGET_DIR: "/github/home/target/debug"
48-
49-
clippy:
50-
name: Clippy
51-
runs-on: ubuntu-latest
52-
timeout-minutes: 60
53-
strategy:
54-
matrix:
55-
rust: [1.62.0]
56-
container:
57-
image: rust:${{ matrix.rust }}-slim-bullseye
58-
env:
59-
RUSTFLAGS: "-C debuginfo=1"
60-
steps:
61-
- uses: actions/checkout@v3
62-
# with:
63-
# submodules: true
64-
- name: Cache Cargo
65-
uses: actions/cache@v3
66-
with:
67-
path: /github/home/.cargo
68-
key: cargo-cache-
69-
- name: Cache Rust dependencies
70-
uses: actions/cache@v3
46+
- uses: actions/checkout@v4
7147
with:
72-
path: /github/home/target
73-
key: ${{ runner.os }}-target-cache-${{ matrix.rust }}-
74-
- name: Cache Build Dependencies
48+
submodules: true
49+
- name: Cache Rust Dependencies
7550
uses: actions/cache@v3
7651
with:
77-
path: /github/home
78-
key: ${{ runner.os }}-toolchain-cache-
79-
- name: Setup Build Environment
80-
run: |
81-
apt update
82-
apt install --yes gcc g++ libssl-dev pkg-config cmake
83-
rm -rf /var/lib/apt/lists/*
84-
- name: Install Clippy
85-
run: |
86-
rustup component add clippy
87-
- name: Run Clippy
52+
path: |
53+
~/.cargo
54+
./target
55+
key: horaedb-${{ runner.os }}-${{ hashFiles('rust-toolchain.toml') }}-${{ hashFiles('Cargo.toml') }}
56+
restore-keys: |
57+
horaedb-${{ runner.os }}-
58+
horaedb-${{ runner.os }}-${{ hashFiles('rust-toolchain.toml') }}-
59+
- name: Check License Header
60+
uses: korandoru/hawkeye@v4
61+
- name: Lint
8862
run: |
89-
make clippy
90-
env:
91-
CARGO_HOME: "/github/home/.cargo"
92-
CARGO_TARGET_DIR: "/github/home/target/debug"
63+
make fmt clippy

.github/workflows/release.yml

Lines changed: 162 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,194 @@
1-
# Copyright 2022 HoraeDB Project Authors. Licensed under Apache-2.0.
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
217

18+
# This file is autogenerated by maturin v1.7.4
19+
# To update, run
20+
#
21+
# maturin generate-ci github
22+
#
323
name: Release
424

525
on:
626
push:
7-
tags:
8-
- 'v*'
27+
branches:
28+
- main
29+
- master
30+
pull_request:
31+
workflow_dispatch:
32+
33+
permissions:
34+
contents: read
935

1036
jobs:
11-
build:
12-
runs-on: ${{ matrix.platform.os }}
37+
linux:
38+
runs-on: ${{ matrix.platform.runner }}
1339
strategy:
1440
matrix:
1541
platform:
16-
- os: macos-latest
42+
- runner: ubuntu-latest
1743
target: x86_64
18-
- os: macos-latest
44+
- runner: ubuntu-latest
45+
target: x86
46+
- runner: ubuntu-latest
1947
target: aarch64
20-
- os: ubuntu-latest
21-
target: x86_64
22-
- os: windows-latest
48+
- runner: ubuntu-latest
49+
target: armv7
50+
- runner: ubuntu-latest
51+
target: s390x
52+
- runner: ubuntu-latest
53+
target: ppc64le
54+
steps:
55+
- uses: actions/checkout@v4
56+
- uses: actions/setup-python@v5
57+
with:
58+
python-version: 3.x
59+
- name: Build wheels
60+
uses: PyO3/maturin-action@v1
61+
with:
62+
target: ${{ matrix.platform.target }}
63+
args: --release --out dist
64+
sccache: 'true'
65+
manylinux: auto
66+
- name: Upload wheels
67+
uses: actions/upload-artifact@v4
68+
with:
69+
name: wheels-linux-${{ matrix.platform.target }}
70+
path: dist
71+
72+
musllinux:
73+
runs-on: ${{ matrix.platform.runner }}
74+
strategy:
75+
matrix:
76+
platform:
77+
- runner: ubuntu-latest
2378
target: x86_64
79+
- runner: ubuntu-latest
80+
target: x86
81+
- runner: ubuntu-latest
82+
target: aarch64
83+
- runner: ubuntu-latest
84+
target: armv7
2485
steps:
25-
- uses: actions/checkout@v2
26-
- uses: actions/setup-python@v4
86+
- uses: actions/checkout@v4
87+
- uses: actions/setup-python@v5
2788
with:
28-
python-version: '3.10'
29-
architecture: x64
30-
- name: Install Rust toolchain
31-
uses: actions-rs/toolchain@v1
89+
python-version: 3.x
90+
- name: Build wheels
91+
uses: PyO3/maturin-action@v1
3292
with:
33-
profile: minimal
34-
- uses: Swatinem/rust-cache@v2
35-
- name: Build source distribution
36-
uses: messense/maturin-action@v1
37-
if: ${{ matrix.platform.os == 'ubuntu-latest' && matrix.platform.target == 'x86_64' }}
93+
target: ${{ matrix.platform.target }}
94+
args: --release --out dist
95+
sccache: 'true'
96+
manylinux: musllinux_1_2
97+
- name: Upload wheels
98+
uses: actions/upload-artifact@v4
3899
with:
39-
command: sdist
40-
args: --out dist
100+
name: wheels-musllinux-${{ matrix.platform.target }}
101+
path: dist
102+
103+
windows:
104+
runs-on: ${{ matrix.platform.runner }}
105+
strategy:
106+
matrix:
107+
platform:
108+
- runner: windows-latest
109+
target: x64
110+
- runner: windows-latest
111+
target: x86
112+
steps:
113+
- uses: actions/checkout@v4
114+
- uses: actions/setup-python@v5
115+
with:
116+
python-version: 3.x
117+
architecture: ${{ matrix.platform.target }}
118+
- name: Build wheels
119+
uses: PyO3/maturin-action@v1
120+
with:
121+
target: ${{ matrix.platform.target }}
122+
args: --release --out dist
123+
sccache: 'true'
124+
- name: Upload wheels
125+
uses: actions/upload-artifact@v4
126+
with:
127+
name: wheels-windows-${{ matrix.platform.target }}
128+
path: dist
129+
130+
macos:
131+
runs-on: ${{ matrix.platform.runner }}
132+
strategy:
133+
matrix:
134+
platform:
135+
- runner: macos-latest
136+
target: universal2-apple-darwin
137+
steps:
138+
- uses: actions/checkout@v4
139+
- uses: actions/setup-python@v5
140+
with:
141+
python-version: 3.x
41142
- name: Build wheels
42-
uses: messense/maturin-action@v1
143+
uses: PyO3/maturin-action@v1
43144
with:
44145
target: ${{ matrix.platform.target }}
45-
manylinux: manylinux2014
46146
args: --release --out dist
147+
sccache: 'true'
47148
- name: Upload wheels
48-
uses: actions/upload-artifact@v2
149+
uses: actions/upload-artifact@v4
49150
with:
50-
name: wheels
151+
name: wheels-macos-${{ matrix.platform.target }}
152+
path: dist
153+
154+
sdist:
155+
runs-on: ubuntu-latest
156+
steps:
157+
- uses: actions/checkout@v4
158+
- name: Build sdist
159+
uses: PyO3/maturin-action@v1
160+
with:
161+
command: sdist
162+
args: --out dist
163+
- name: Upload sdist
164+
uses: actions/upload-artifact@v4
165+
with:
166+
name: wheels-sdist
51167
path: dist
52168

53169
release:
54170
name: Release
55171
runs-on: ubuntu-latest
56-
if: "startsWith(github.ref, 'refs/tags/')"
57-
needs: [ build ]
172+
if: ${{ github.event_name == 'workflow_dispatch' }}
173+
needs: [linux, musllinux, windows, macos, sdist]
174+
permissions:
175+
# Use to sign the release artifacts
176+
id-token: write
177+
# Used to upload release artifacts
178+
contents: write
179+
# Used to generate artifact attestation
180+
attestations: write
58181
steps:
59-
- uses: actions/download-artifact@v2
60-
with:
61-
name: wheels
62-
- uses: actions/setup-python@v4
182+
- uses: actions/download-artifact@v4
183+
- name: Generate artifact attestation
184+
uses: actions/attest-build-provenance@v1
63185
with:
64-
python-version: '3.10'
186+
subject-path: 'wheels-*/*'
65187
- name: Publish to PyPI
188+
if: "startsWith(github.ref, 'refs/tags/')"
189+
uses: PyO3/maturin-action@v1
66190
env:
67-
TWINE_USERNAME: __token__
68-
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
69-
run: |
70-
pip install twine
71-
twine upload --skip-existing *
191+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
192+
with:
193+
command: upload
194+
args: --non-interactive --skip-existing wheels-*/*

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ __pycache__/
55
.idea
66
.python-version
77
dist
8+
.env
9+
env

0 commit comments

Comments
 (0)