dwg2pdf 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,137 @@
1
+ name: Release
2
+
3
+ # 发布 GitHub Release 时自动构建多平台产物:
4
+ # - Python wheels(maturin,多平台)
5
+ # - 源码包 sdist
6
+ # - 各平台 CLI 可执行文件
7
+ # 全部作为附件上传到该 Release,并把 wheels + sdist 发布到 PyPI。
8
+ #
9
+ # 需要配置的 secret:PYPI_API_TOKEN(PyPI 的 API Token)。
10
+ on:
11
+ release:
12
+ types: [published]
13
+
14
+ permissions:
15
+ contents: write
16
+
17
+ env:
18
+ CARGO_TERM_COLOR: always
19
+ BIN_NAME: dwg2pdf
20
+
21
+ jobs:
22
+ # ---------------------------------------------------------------------------
23
+ # Python wheels(maturin)
24
+ # ---------------------------------------------------------------------------
25
+ wheels:
26
+ name: wheels / ${{ matrix.target }}
27
+ runs-on: ${{ matrix.os }}
28
+ strategy:
29
+ fail-fast: false
30
+ matrix:
31
+ include:
32
+ - { os: ubuntu-latest, target: x86_64, manylinux: manylinux2014 }
33
+ - { os: ubuntu-latest, target: aarch64, manylinux: manylinux2014 }
34
+ - { os: macos-latest, target: x86_64 }
35
+ - { os: macos-latest, target: aarch64 }
36
+ - { os: windows-latest, target: x64 }
37
+ steps:
38
+ - uses: actions/checkout@v4
39
+ - uses: PyO3/maturin-action@v1
40
+ with:
41
+ target: ${{ matrix.target }}
42
+ manylinux: ${{ matrix.manylinux || 'auto' }}
43
+ args: --release --out dist
44
+ - uses: actions/upload-artifact@v4
45
+ with:
46
+ name: wheels-${{ matrix.os }}-${{ matrix.target }}
47
+ path: dist/*.whl
48
+ if-no-files-found: error
49
+
50
+ # ---------------------------------------------------------------------------
51
+ # 源码包 sdist(pip 可基于源码构建)
52
+ # ---------------------------------------------------------------------------
53
+ sdist:
54
+ name: sdist
55
+ runs-on: ubuntu-latest
56
+ steps:
57
+ - uses: actions/checkout@v4
58
+ - uses: PyO3/maturin-action@v1
59
+ with:
60
+ command: sdist
61
+ args: --out dist
62
+ - uses: actions/upload-artifact@v4
63
+ with:
64
+ name: sdist
65
+ path: dist/*.tar.gz
66
+ if-no-files-found: error
67
+
68
+ # ---------------------------------------------------------------------------
69
+ # 各平台 CLI 可执行文件
70
+ # 说明:Linux 使用 musl 静态链接;aarch64 由 ubuntu-latest 交叉编译。
71
+ # ---------------------------------------------------------------------------
72
+ cli:
73
+ name: cli / ${{ matrix.target }}
74
+ runs-on: ${{ matrix.os }}
75
+ strategy:
76
+ fail-fast: false
77
+ matrix:
78
+ include:
79
+ - { os: ubuntu-latest, target: x86_64-unknown-linux-musl }
80
+ - { os: ubuntu-latest, target: aarch64-unknown-linux-musl }
81
+ - { os: macos-latest, target: x86_64-apple-darwin }
82
+ - { os: macos-latest, target: aarch64-apple-darwin }
83
+ - { os: windows-latest, target: x86_64-pc-windows-msvc }
84
+ steps:
85
+ - uses: actions/checkout@v4
86
+ - uses: dtolnay/rust-toolchain@stable
87
+ with:
88
+ targets: ${{ matrix.target }}
89
+ - uses: Swatinem/rust-cache@v2
90
+ with:
91
+ key: ${{ matrix.target }}
92
+ # 构建并直接上传压缩包(含 sha256)到当前 Release
93
+ - uses: taiki-e/upload-rust-binary-action@v1
94
+ with:
95
+ bin: ${{ env.BIN_NAME }}
96
+ target: ${{ matrix.target }}
97
+ archive: ${{ env.BIN_NAME }}-$target
98
+ checksum: sha256
99
+ token: ${{ secrets.GITHUB_TOKEN }}
100
+
101
+ # ---------------------------------------------------------------------------
102
+ # 汇总 wheels + sdist 上传到 Release(CLI 已由上面的 action 直接上传)
103
+ # ---------------------------------------------------------------------------
104
+ publish:
105
+ name: publish assets
106
+ needs: [wheels, sdist]
107
+ runs-on: ubuntu-latest
108
+ steps:
109
+ - uses: actions/download-artifact@v4
110
+ with:
111
+ path: dist
112
+ merge-multiple: true
113
+ - uses: softprops/action-gh-release@v2
114
+ with:
115
+ files: dist/*
116
+ tag_name: ${{ github.event.release.tag_name }}
117
+
118
+ # ---------------------------------------------------------------------------
119
+ # 发布到 PyPI(wheels + sdist)
120
+ # 使用仓库 secret:PYPI_API_TOKEN
121
+ # ---------------------------------------------------------------------------
122
+ pypi:
123
+ name: publish to PyPI
124
+ needs: [wheels, sdist]
125
+ runs-on: ubuntu-latest
126
+ environment:
127
+ name: pypi
128
+ url: https://pypi.org/p/dwg2pdf
129
+ steps:
130
+ - uses: actions/download-artifact@v4
131
+ with:
132
+ path: dist
133
+ merge-multiple: true
134
+ - uses: pypa/gh-action-pypi-publish@release/v1
135
+ with:
136
+ password: ${{ secrets.PYPI_API_TOKEN }}
137
+ skip-existing: true
@@ -0,0 +1,11 @@
1
+ /target
2
+ /.venv
3
+ __pycache__/
4
+ *.py[cod]
5
+ /dist
6
+ *.whl
7
+
8
+ # 生成的 PDF 与调试输出
9
+ /out*.pdf
10
+ err.txt
11
+ lay_jgkx.txt