|
| 1 | +name: Publish |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "v*" |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 14 | + cancel-in-progress: false |
| 15 | + |
| 16 | +env: |
| 17 | + CARGO_TERM_COLOR: always |
| 18 | + |
| 19 | +jobs: |
| 20 | + build-binoc-wheels: |
| 21 | + name: Build binoc wheels (${{ matrix.artifact }}) |
| 22 | + runs-on: ${{ matrix.os }} |
| 23 | + permissions: |
| 24 | + contents: read |
| 25 | + strategy: |
| 26 | + fail-fast: false |
| 27 | + matrix: |
| 28 | + include: |
| 29 | + - os: ubuntu-latest |
| 30 | + artifact: linux-x86_64 |
| 31 | + target: x86_64-unknown-linux-gnu |
| 32 | + manylinux: auto |
| 33 | + - os: windows-latest |
| 34 | + artifact: windows-x86_64 |
| 35 | + target: x86_64-pc-windows-msvc |
| 36 | + manylinux: off |
| 37 | + - os: macos-13 |
| 38 | + artifact: macos-x86_64 |
| 39 | + target: x86_64-apple-darwin |
| 40 | + manylinux: off |
| 41 | + - os: macos-14 |
| 42 | + artifact: macos-aarch64 |
| 43 | + target: aarch64-apple-darwin |
| 44 | + manylinux: off |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
| 47 | + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 |
| 48 | + with: |
| 49 | + python-version: "3.10" |
| 50 | + - uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1 |
| 51 | + with: |
| 52 | + command: build |
| 53 | + working-directory: binoc-python |
| 54 | + target: ${{ matrix.target }} |
| 55 | + manylinux: ${{ matrix.manylinux }} |
| 56 | + args: --release --interpreter python --out dist |
| 57 | + sccache: "true" |
| 58 | + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 |
| 59 | + with: |
| 60 | + name: binoc-dist-${{ matrix.artifact }} |
| 61 | + path: binoc-python/dist |
| 62 | + |
| 63 | + build-binoc-sdist: |
| 64 | + name: Build binoc sdist |
| 65 | + runs-on: ubuntu-latest |
| 66 | + permissions: |
| 67 | + contents: read |
| 68 | + steps: |
| 69 | + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
| 70 | + - uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1 |
| 71 | + with: |
| 72 | + command: sdist |
| 73 | + working-directory: binoc-python |
| 74 | + args: --out dist |
| 75 | + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 |
| 76 | + with: |
| 77 | + name: binoc-dist-sdist |
| 78 | + path: binoc-python/dist |
| 79 | + |
| 80 | + publish-binoc: |
| 81 | + name: Publish binoc to PyPI |
| 82 | + runs-on: ubuntu-latest |
| 83 | + needs: [build-binoc-wheels, build-binoc-sdist] |
| 84 | + environment: |
| 85 | + name: pypi-binoc |
| 86 | + url: https://pypi.org/project/binoc/ |
| 87 | + permissions: |
| 88 | + contents: read |
| 89 | + id-token: write |
| 90 | + steps: |
| 91 | + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 |
| 92 | + with: |
| 93 | + pattern: binoc-dist-* |
| 94 | + path: dist |
| 95 | + merge-multiple: true |
| 96 | + - uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1 |
| 97 | + with: |
| 98 | + packages-dir: dist |
| 99 | + |
| 100 | + build-binoc-sqlite-wheels: |
| 101 | + name: Build binoc-sqlite wheels (${{ matrix.artifact }}) |
| 102 | + runs-on: ${{ matrix.os }} |
| 103 | + permissions: |
| 104 | + contents: read |
| 105 | + strategy: |
| 106 | + fail-fast: false |
| 107 | + matrix: |
| 108 | + include: |
| 109 | + - os: ubuntu-latest |
| 110 | + artifact: linux-x86_64 |
| 111 | + target: x86_64-unknown-linux-gnu |
| 112 | + manylinux: auto |
| 113 | + - os: windows-latest |
| 114 | + artifact: windows-x86_64 |
| 115 | + target: x86_64-pc-windows-msvc |
| 116 | + manylinux: off |
| 117 | + - os: macos-13 |
| 118 | + artifact: macos-x86_64 |
| 119 | + target: x86_64-apple-darwin |
| 120 | + manylinux: off |
| 121 | + - os: macos-14 |
| 122 | + artifact: macos-aarch64 |
| 123 | + target: aarch64-apple-darwin |
| 124 | + manylinux: off |
| 125 | + steps: |
| 126 | + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
| 127 | + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 |
| 128 | + with: |
| 129 | + python-version: "3.10" |
| 130 | + - uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1 |
| 131 | + with: |
| 132 | + command: build |
| 133 | + working-directory: model-plugins/binoc-sqlite |
| 134 | + target: ${{ matrix.target }} |
| 135 | + manylinux: ${{ matrix.manylinux }} |
| 136 | + args: --release --interpreter python --out dist |
| 137 | + sccache: "true" |
| 138 | + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 |
| 139 | + with: |
| 140 | + name: binoc-sqlite-dist-${{ matrix.artifact }} |
| 141 | + path: model-plugins/binoc-sqlite/dist |
| 142 | + |
| 143 | + build-binoc-sqlite-sdist: |
| 144 | + name: Build binoc-sqlite sdist |
| 145 | + runs-on: ubuntu-latest |
| 146 | + permissions: |
| 147 | + contents: read |
| 148 | + steps: |
| 149 | + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
| 150 | + - uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1 |
| 151 | + with: |
| 152 | + command: sdist |
| 153 | + working-directory: model-plugins/binoc-sqlite |
| 154 | + args: --out dist |
| 155 | + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 |
| 156 | + with: |
| 157 | + name: binoc-sqlite-dist-sdist |
| 158 | + path: model-plugins/binoc-sqlite/dist |
| 159 | + |
| 160 | + publish-binoc-sqlite: |
| 161 | + name: Publish binoc-sqlite to PyPI |
| 162 | + runs-on: ubuntu-latest |
| 163 | + needs: [build-binoc-sqlite-wheels, build-binoc-sqlite-sdist] |
| 164 | + environment: |
| 165 | + name: pypi-binoc-sqlite |
| 166 | + url: https://pypi.org/project/binoc-sqlite/ |
| 167 | + permissions: |
| 168 | + contents: read |
| 169 | + id-token: write |
| 170 | + steps: |
| 171 | + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 |
| 172 | + with: |
| 173 | + pattern: binoc-sqlite-dist-* |
| 174 | + path: dist |
| 175 | + merge-multiple: true |
| 176 | + - uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1 |
| 177 | + with: |
| 178 | + packages-dir: dist |
| 179 | + |
| 180 | + publish-binoc-sdk: |
| 181 | + name: Publish binoc-sdk to crates.io |
| 182 | + runs-on: ubuntu-latest |
| 183 | + environment: |
| 184 | + name: crates-io-binoc-sdk |
| 185 | + url: https://crates.io/crates/binoc-sdk |
| 186 | + permissions: |
| 187 | + contents: read |
| 188 | + id-token: write |
| 189 | + steps: |
| 190 | + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
| 191 | + - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable |
| 192 | + - uses: rust-lang/crates-io-auth-action@b7e9a28eded4986ec6b1fa40eeee8f8f165559ec # v1 |
| 193 | + id: auth |
| 194 | + - run: cargo publish -p binoc-sdk --locked |
| 195 | + env: |
| 196 | + CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} |
0 commit comments