|
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. |
2 | 17 |
|
| 18 | +# This file is autogenerated by maturin v1.7.4 |
| 19 | +# To update, run |
| 20 | +# |
| 21 | +# maturin generate-ci github |
| 22 | +# |
3 | 23 | name: Release |
4 | 24 |
|
5 | 25 | on: |
6 | 26 | push: |
7 | | - tags: |
8 | | - - 'v*' |
| 27 | + branches: |
| 28 | + - main |
| 29 | + - master |
| 30 | + pull_request: |
| 31 | + workflow_dispatch: |
| 32 | + |
| 33 | +permissions: |
| 34 | + contents: read |
9 | 35 |
|
10 | 36 | jobs: |
11 | | - build: |
12 | | - runs-on: ${{ matrix.platform.os }} |
| 37 | + linux: |
| 38 | + runs-on: ${{ matrix.platform.runner }} |
13 | 39 | strategy: |
14 | 40 | matrix: |
15 | 41 | platform: |
16 | | - - os: macos-latest |
| 42 | + - runner: ubuntu-latest |
17 | 43 | target: x86_64 |
18 | | - - os: macos-latest |
| 44 | + - runner: ubuntu-latest |
| 45 | + target: x86 |
| 46 | + - runner: ubuntu-latest |
19 | 47 | 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 |
23 | 78 | target: x86_64 |
| 79 | + - runner: ubuntu-latest |
| 80 | + target: x86 |
| 81 | + - runner: ubuntu-latest |
| 82 | + target: aarch64 |
| 83 | + - runner: ubuntu-latest |
| 84 | + target: armv7 |
24 | 85 | steps: |
25 | | - - uses: actions/checkout@v2 |
26 | | - - uses: actions/setup-python@v4 |
| 86 | + - uses: actions/checkout@v4 |
| 87 | + - uses: actions/setup-python@v5 |
27 | 88 | 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 |
32 | 92 | 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 |
38 | 99 | 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 |
41 | 142 | - name: Build wheels |
42 | | - uses: messense/maturin-action@v1 |
| 143 | + uses: PyO3/maturin-action@v1 |
43 | 144 | with: |
44 | 145 | target: ${{ matrix.platform.target }} |
45 | | - manylinux: manylinux2014 |
46 | 146 | args: --release --out dist |
| 147 | + sccache: 'true' |
47 | 148 | - name: Upload wheels |
48 | | - uses: actions/upload-artifact@v2 |
| 149 | + uses: actions/upload-artifact@v4 |
49 | 150 | 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 |
51 | 167 | path: dist |
52 | 168 |
|
53 | 169 | release: |
54 | 170 | name: Release |
55 | 171 | 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 |
58 | 181 | 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 |
63 | 185 | with: |
64 | | - python-version: '3.10' |
| 186 | + subject-path: 'wheels-*/*' |
65 | 187 | - name: Publish to PyPI |
| 188 | + if: "startsWith(github.ref, 'refs/tags/')" |
| 189 | + uses: PyO3/maturin-action@v1 |
66 | 190 | 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-*/* |
0 commit comments