|
| 1 | +name: Build Plugin |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: ["plugin-*-v*"] |
| 6 | + |
| 7 | +env: |
| 8 | + XCODE_PROJECT: TablePro.xcodeproj |
| 9 | + |
| 10 | +jobs: |
| 11 | + build-plugin: |
| 12 | + name: Build Plugin |
| 13 | + runs-on: self-hosted |
| 14 | + timeout-minutes: 30 |
| 15 | + |
| 16 | + steps: |
| 17 | + - name: Extract plugin info from tag |
| 18 | + id: plugin-info |
| 19 | + run: | |
| 20 | + TAG="${GITHUB_REF#refs/tags/}" |
| 21 | + # Tag format: plugin-<name>-v<version> |
| 22 | + # e.g., plugin-oracle-v1.0.0 -> OracleDriverPlugin |
| 23 | + PLUGIN_NAME=$(echo "$TAG" | sed -E 's/^plugin-([a-z]+)-v.*$/\1/') |
| 24 | + VERSION=$(echo "$TAG" | sed -E 's/^plugin-[a-z]+-v(.*)$/\1/') |
| 25 | +
|
| 26 | + # Map short name to Xcode target |
| 27 | + case "$PLUGIN_NAME" in |
| 28 | + oracle) TARGET="OracleDriverPlugin" ;; |
| 29 | + clickhouse) TARGET="ClickHouseDriverPlugin" ;; |
| 30 | + *) echo "Unknown plugin: $PLUGIN_NAME"; exit 1 ;; |
| 31 | + esac |
| 32 | +
|
| 33 | + echo "target=$TARGET" >> "$GITHUB_OUTPUT" |
| 34 | + echo "version=$VERSION" >> "$GITHUB_OUTPUT" |
| 35 | + echo "plugin_name=$PLUGIN_NAME" >> "$GITHUB_OUTPUT" |
| 36 | + echo "Building $TARGET v$VERSION" |
| 37 | +
|
| 38 | + - name: Install Git LFS |
| 39 | + run: brew list git-lfs &>/dev/null || brew install git-lfs; git lfs install |
| 40 | + |
| 41 | + - name: Checkout code |
| 42 | + uses: actions/checkout@v4 |
| 43 | + with: |
| 44 | + lfs: true |
| 45 | + |
| 46 | + - name: Pull LFS files |
| 47 | + run: git lfs pull |
| 48 | + |
| 49 | + - name: Build plugin (ARM64) |
| 50 | + run: ./scripts/build-plugin.sh "${{ steps.plugin-info.outputs.target }}" arm64 |
| 51 | + |
| 52 | + - name: Build plugin (x86_64) |
| 53 | + run: ./scripts/build-plugin.sh "${{ steps.plugin-info.outputs.target }}" x86_64 |
| 54 | + |
| 55 | + - name: Notarize |
| 56 | + if: env.NOTARIZE == 'true' |
| 57 | + env: |
| 58 | + NOTARIZE: "true" |
| 59 | + run: | |
| 60 | + for zip in build/Plugins/*.zip; do |
| 61 | + xcrun notarytool submit "$zip" \ |
| 62 | + --apple-id "$APPLE_ID" \ |
| 63 | + --team-id "D7HJ5TFYCU" \ |
| 64 | + --keychain-profile "notarytool-profile" \ |
| 65 | + --wait |
| 66 | + done |
| 67 | +
|
| 68 | + - name: Create GitHub Release |
| 69 | + uses: softprops/action-gh-release@v2 |
| 70 | + with: |
| 71 | + name: "${{ steps.plugin-info.outputs.target }} v${{ steps.plugin-info.outputs.version }}" |
| 72 | + body: | |
| 73 | + ## ${{ steps.plugin-info.outputs.target }} v${{ steps.plugin-info.outputs.version }} |
| 74 | +
|
| 75 | + Plugin release for TablePro. |
| 76 | +
|
| 77 | + ### Installation |
| 78 | + Download the ZIP for your architecture and install via **Settings > Plugins > Install from File**. |
| 79 | + files: build/Plugins/*.zip |
| 80 | + draft: false |
| 81 | + prerelease: false |
0 commit comments