Skip to content

Commit 297171f

Browse files
committed
feat: finished rust package, added tsv support to cli, removed pg support, added perf boost
1 parent a0270a0 commit 297171f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1237
-2846
lines changed

.github/release-draft-rs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name-template: excel-rs $RESOLVED_VERSION
2+
tag-template: rs-$RESOLVED_VERSION
3+
tag-prefix: rs-
4+
template: Version $RESOLVED_VERSION of excel-rs is now available!

.github/workflows/cli.yml

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
1-
# This file is autogenerated by maturin v1.7.1
2-
# To update, run
3-
#
4-
# maturin generate-ci github
5-
#
6-
name: CLI release
1+
name: CLI Release
72

83
on:
94
push:
105
branches:
116
- main
127
- master
138
paths:
14-
- cli-excel-rs/*
9+
- cli-excel-rs/**
1510
tags:
16-
- '*'
11+
- 'cli-v*'
1712
pull_request:
1813
workflow_dispatch:
1914

@@ -28,21 +23,13 @@ jobs:
2823
platform:
2924
- runner: ubuntu-latest
3025
target: x86_64
31-
# - runner: ubuntu-latest
32-
# target: x86
3326
- runner: ubuntu-latest
3427
target: aarch64
35-
# - runner: ubuntu-latest
36-
# target: armv7
37-
# - runner: ubuntu-latest
38-
# target: s390x
39-
# - runner: ubuntu-latest
40-
# target: ppc64le
4128
steps:
4229
- uses: actions/checkout@v4
4330
- uses: dtolnay/rust-toolchain@stable
4431
- run: cargo build --release --package cli-excel-rs --all-features
45-
- run: cd target/release && zip ../../excel-rs-linux-${{ matrix.platform.target }}.zip cli-excel-rs
32+
- run: cd target/release && zip ../../excel-rs-linux-${{ matrix.platform.target }}.zip cli-excel-rs
4633
- name: Upload artifacts
4734
uses: actions/upload-artifact@v4
4835
with:
@@ -62,7 +49,7 @@ jobs:
6249
- uses: actions/checkout@v4
6350
- uses: dtolnay/rust-toolchain@stable
6451
- run: cargo build --release --package cli-excel-rs --all-features
65-
- run: cd target/release && zip ../../excel-rs-macos-${{ matrix.platform.target }}.zip cli-excel-rs
52+
- run: cd target/release && zip ../../excel-rs-macos-${{ matrix.platform.target }}.zip cli-excel-rs
6653
- name: Upload artifacts
6754
uses: actions/upload-artifact@v4
6855
with:
@@ -72,23 +59,27 @@ jobs:
7259
release:
7360
name: Release
7461
runs-on: ubuntu-latest
62+
# Only publish when a cli-v* tag is pushed
63+
if: startsWith(github.ref, 'refs/tags/cli-v')
7564
needs: [linux, macos]
7665
permissions:
7766
contents: write
7867
id-token: write
7968
pull-requests: write
8069
steps:
8170
- uses: actions/checkout@v4
82-
- name: Get version from Cargo.toml
71+
- name: Get version from tag
8372
id: version
8473
run: |
85-
VERSION=$(grep -m 1 -oP 'version = "\K[^"]+' cli-excel-rs/Cargo.toml)
74+
TAG="${GITHUB_REF#refs/tags/}"
75+
VERSION="${TAG#cli-v}"
8676
if [[ "$VERSION" == *"-"* ]]; then
8777
IS_PRERELEASE=true
8878
else
8979
IS_PRERELEASE=false
9080
fi
9181
echo "version=$VERSION" >> $GITHUB_OUTPUT
82+
echo "tag=$TAG" >> $GITHUB_OUTPUT
9283
echo "is_prerelease=$IS_PRERELEASE" >> $GITHUB_OUTPUT
9384
- uses: actions/download-artifact@v4
9485
- name: Create GitHub release
@@ -97,21 +88,19 @@ jobs:
9788
with:
9889
config-name: release-draft-cli.yml
9990
name: cli-excel-rs ${{ steps.version.outputs.version }}
100-
tag: cli-${{ steps.version.outputs.version }}
91+
tag: ${{ steps.version.outputs.tag }}
10192
version: ${{ steps.version.outputs.version }}
10293
disable-autolabeler: true
10394
env:
10495
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
105-
10696
- name: Upload binaries to GitHub release
10797
run: gh release upload $TAG $FILES --clobber
10898
env:
10999
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110-
TAG: ${{ steps.github-release.outputs.tag_name }}
100+
TAG: ${{ steps.version.outputs.tag }}
111101
FILES: excel-rs-*/*
112-
113102
- name: Publish GitHub release
114103
run: gh release edit $TAG --draft=false
115104
env:
116105
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
117-
TAG: ${{ steps.github-release.outputs.tag_name }}
106+
TAG: ${{ steps.version.outputs.tag }}

.github/workflows/release.yml

Lines changed: 12 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
1-
# This file is autogenerated by maturin v1.7.1
2-
# To update, run
3-
#
4-
# maturin generate-ci github
5-
#
6-
name: CI
1+
name: Python Release
72

83
on:
94
push:
105
branches:
116
- main
127
- master
138
paths:
14-
- py-excel-rs/pyproject.toml
9+
- py-excel-rs/**
1510
tags:
16-
- '*'
11+
- 'py-v*'
1712
pull_request:
1813
workflow_dispatch:
1914

@@ -28,16 +23,8 @@ jobs:
2823
platform:
2924
- runner: ubuntu-latest
3025
target: x86_64
31-
# - runner: ubuntu-latest
32-
# target: x86
3326
- runner: ubuntu-latest
3427
target: aarch64
35-
# - runner: ubuntu-latest
36-
# target: armv7
37-
# - runner: ubuntu-latest
38-
# target: s390x
39-
# - runner: ubuntu-latest
40-
# target: ppc64le
4128
steps:
4229
- uses: actions/checkout@v4
4330
- uses: actions/setup-python@v5
@@ -72,12 +59,8 @@ jobs:
7259
platform:
7360
- runner: ubuntu-latest
7461
target: x86_64
75-
# - runner: ubuntu-latest
76-
# target: x86
7762
- runner: ubuntu-latest
7863
target: aarch64
79-
# - runner: ubuntu-latest
80-
# target: armv7
8164
steps:
8265
- uses: actions/checkout@v4
8366
- uses: actions/setup-python@v5
@@ -97,33 +80,6 @@ jobs:
9780
name: whl-py-excel-rs-musllinux-${{ matrix.platform.target }}
9881
path: dist
9982

100-
# windows:
101-
# runs-on: ${{ matrix.platform.runner }}
102-
# strategy:
103-
# matrix:
104-
# platform:
105-
# - runner: windows-latest
106-
# target: x64
107-
# - runner: windows-latest
108-
# target: x86
109-
# steps:
110-
# - uses: actions/checkout@v4
111-
# - uses: actions/setup-python@v5
112-
# with:
113-
# python-version: 3.x
114-
# architecture: ${{ matrix.platform.target }}
115-
# - name: Build wheels
116-
# uses: PyO3/maturin-action@v1
117-
# with:
118-
# target: ${{ matrix.platform.target }}
119-
# args: --release --out dist --find-interpreter
120-
# sccache: 'true'
121-
# - name: Upload wheels
122-
# uses: actions/upload-artifact@v4
123-
# with:
124-
# name: py-excel-rs-windows-${{ matrix.platform.target }}
125-
# path: dist
126-
12783
macos:
12884
runs-on: ${{ matrix.platform.runner }}
12985
strategy:
@@ -170,23 +126,27 @@ jobs:
170126
release:
171127
name: Release
172128
runs-on: ubuntu-latest
129+
# Only publish when a py-v* tag is pushed
130+
if: startsWith(github.ref, 'refs/tags/py-v')
173131
needs: [linux, musllinux, macos, sdist]
174132
permissions:
175133
contents: write
176134
id-token: write
177135
pull-requests: write
178136
steps:
179137
- uses: actions/checkout@v4
180-
- name: Get version from Cargo.toml
138+
- name: Get version from tag
181139
id: version
182140
run: |
183-
VERSION=$(grep -m 1 -oP 'version = "\K[^"]+' Cargo.toml)
141+
TAG="${GITHUB_REF#refs/tags/}"
142+
VERSION="${TAG#py-v}"
184143
if [[ "$VERSION" == *"-"* ]]; then
185144
IS_PRERELEASE=true
186145
else
187146
IS_PRERELEASE=false
188147
fi
189148
echo "version=$VERSION" >> $GITHUB_OUTPUT
149+
echo "tag=$TAG" >> $GITHUB_OUTPUT
190150
echo "is_prerelease=$IS_PRERELEASE" >> $GITHUB_OUTPUT
191151
- uses: actions/download-artifact@v4
192152
- name: Create GitHub release
@@ -195,24 +155,22 @@ jobs:
195155
with:
196156
config-name: release-draft.yml
197157
name: py-excel-rs ${{ steps.version.outputs.version }}
198-
tag: py-${{ steps.version.outputs.version }}
158+
tag: ${{ steps.version.outputs.tag }}
199159
version: ${{ steps.version.outputs.version }}
200160
disable-autolabeler: true
201161
env:
202162
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
203-
204163
- name: Upload sdist to GitHub release
205164
run: gh release upload $TAG $FILES --clobber
206165
env:
207166
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
208-
TAG: ${{ steps.github-release.outputs.tag_name }}
167+
TAG: ${{ steps.version.outputs.tag }}
209168
FILES: py-excel-rs-sdist/*
210-
211169
- name: Publish GitHub release
212170
run: gh release edit $TAG --draft=false
213171
env:
214172
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
215-
TAG: ${{ steps.github-release.outputs.tag_name }}
173+
TAG: ${{ steps.version.outputs.tag }}
216174
- name: Publish to PyPI
217175
uses: PyO3/maturin-action@v1
218176
with:

.github/workflows/rs.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Rust Crate Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'rs-v*'
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
check:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: dtolnay/rust-toolchain@stable
17+
- run: cargo test --package excel-rs
18+
- run: cargo clippy --package excel-rs -- -D warnings
19+
20+
publish:
21+
name: Publish to crates.io
22+
runs-on: ubuntu-latest
23+
needs: [check]
24+
permissions:
25+
contents: write
26+
id-token: write
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: dtolnay/rust-toolchain@stable
30+
- name: Get version from tag
31+
id: version
32+
run: |
33+
TAG="${GITHUB_REF#refs/tags/}"
34+
VERSION="${TAG#rs-v}"
35+
if [[ "$VERSION" == *"-"* ]]; then
36+
IS_PRERELEASE=true
37+
else
38+
IS_PRERELEASE=false
39+
fi
40+
echo "version=$VERSION" >> $GITHUB_OUTPUT
41+
echo "tag=$TAG" >> $GITHUB_OUTPUT
42+
echo "is_prerelease=$IS_PRERELEASE" >> $GITHUB_OUTPUT
43+
- name: Publish excel-rs
44+
run: cargo publish --package excel-rs
45+
env:
46+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
47+
- name: Create GitHub release
48+
uses: release-drafter/release-drafter@v6
49+
with:
50+
config-name: release-draft-rs.yml
51+
name: excel-rs ${{ steps.version.outputs.version }}
52+
tag: ${{ steps.version.outputs.tag }}
53+
version: ${{ steps.version.outputs.version }}
54+
disable-autolabeler: true
55+
publish: true
56+
prerelease: ${{ steps.version.outputs.is_prerelease }}
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)