diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d18dcb8..588f8b8 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -73,7 +73,38 @@ jobs: with: name: sqlite-http-macos-wheels path: dist/wheels/*.whl - + build-macos-arm-extension: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + # using actions/setup-go@v1 is the only way to get macos build to work. + # otherwise, with v2, would get this cgo error: 'cgo-generated-wrappers:13:13: error: redefinition of 'free' as different kind of symbol' + - name: Set up Go 1.20 + uses: actions/setup-go@v1 + with: + go-version: 1.20 + - run: GOOS=darwin GOARCH=arm64 CC="gcc -target arm64-apple-macos11" make loadable + - uses: actions/upload-artifact@v3 + with: + name: sqlite-http-macos-arm + path: dist/http0.dylib + build-macos-arm-python: + runs-on: macos-latest + needs: [build-macos-arm-extension] + steps: + - uses: actions/checkout@v3 + - name: Download workflow artifacts + uses: actions/download-artifact@v3 + with: + name: sqlite-http-macos-arm + path: dist/ + - uses: actions/setup-python@v3 + - run: pip install wheel + - run: make python IS_MACOS_ARM=1 + - uses: actions/upload-artifact@v3 + with: + name: sqlite-http-macos-arm-wheels + path: dist/wheels/*.whl build-windows-extension: name: Building windows extension runs-on: windows-latest @@ -113,6 +144,7 @@ jobs: needs: [ build-macos-extension, + build-macos-arm-extension, build-linux_x86-extension, build-windows-extension, ] @@ -130,12 +162,14 @@ jobs: platforms: | linux-x86_64: sqlite-http-linux_x86/* macos-x86_64: sqlite-http-macos/* + macos-aarch64: sqlite-http-macos-arm/* windows-x86_64: sqlite-http-windows/* upload-deno: name: Upload Deno release assets needs: [ build-macos-extension, + build-macos-arm-extension, build-linux_x86-extension, build-windows-extension, ] @@ -156,6 +190,7 @@ jobs: needs: [ build-macos-extension, + build-macos-arm-extension, build-linux_x86-extension, build-windows-extension, ] @@ -183,6 +218,11 @@ jobs: run: npm publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Publish NPM sqlite-http-darwin-arm64 + working-directory: npm/sqlite-http-darwin-arm64 + run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Publish NPM sqlite-http-windows-x64 working-directory: npm/sqlite-http-windows-x64 run: npm publish --access public @@ -194,7 +234,13 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} upload_pypi: - needs: [build-linux_x86-python, build-macos-python, build-windows-python] + needs: + [ + build-linux_x86-python, + build-macos-python, + build-macos-arm-python, + build-windows-python, + ] runs-on: ubuntu-latest steps: - uses: actions/download-artifact@v3 @@ -209,6 +255,10 @@ jobs: with: name: sqlite-http-macos-wheels path: dist + - uses: actions/download-artifact@v3 + with: + name: sqlite-http-macos-arm-wheels + path: dist - uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.PYPI_API_TOKEN }} @@ -217,6 +267,7 @@ jobs: needs: [ build-macos-extension, + build-macos-arm-extension, build-linux_x86-extension, build-windows-extension, ] @@ -241,6 +292,12 @@ jobs: gem -C bindings/ruby build -o ${{ env.PLATFORM }}.gem sqlite_http.gemspec env: PLATFORM: x86_64-darwin + - run: | + rm bindings/ruby/lib/*.{dylib,so,dll} || true + cp sqlite-http-macos-arm/*.dylib bindings/ruby/lib + gem -C bindings/ruby build -o ${{ env.PLATFORM }}.gem sqlite_http.gemspec + env: + PLATFORM: arm64-darwin - run: | rm bindings/ruby/lib/*.{dylib,so,dll} || true cp sqlite-http-windows/*.dll bindings/ruby/lib @@ -250,6 +307,7 @@ jobs: - run: | gem push bindings/ruby/x86_64-linux.gem gem push bindings/ruby/x86_64-darwin.gem + gem push bindings/ruby/arm64-darwin.gem gem push bindings/ruby/x64-mingw32.gem env: GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }} diff --git a/.github/workflows/upload-deno-assets.js b/.github/workflows/upload-deno-assets.js index 595afb7..f54d6cd 100644 --- a/.github/workflows/upload-deno-assets.js +++ b/.github/workflows/upload-deno-assets.js @@ -5,6 +5,10 @@ const compiled_extensions = [ path: "sqlite-http-macos/http0.dylib", name: "deno-darwin-x86_64.http0.dylib", }, + { + path: "sqlite-http-macos-arm/http0.dylib", + name: "deno-darwin-aarch64.http0.dylib", + }, { path: "sqlite-http-linux_x86/http0.so", name: "deno-linux-x86_64.http0.so", diff --git a/Makefile b/Makefile index 6faeea4..f0fb673 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,12 @@ else PYTHON=python3 endif +ifdef IS_MACOS_ARM +RENAME_WHEELS_ARGS=--is-macos-arm +else +RENAME_WHEELS_ARGS= +endif + prefix=dist TARGET_LOADABLE=$(prefix)/http0.$(LOADABLE_EXTENSION) diff --git a/scripts/npm_generate_platform_packages.sh b/scripts/npm_generate_platform_packages.sh index 10892c4..2fb7cc5 100755 --- a/scripts/npm_generate_platform_packages.sh +++ b/scripts/npm_generate_platform_packages.sh @@ -34,5 +34,6 @@ envsubst < npm/$PACKAGE_NAME_BASE/package.json.tmpl > npm/$PACKAGE_NAME_BASE/pac echo "✅ generated npm/$PACKAGE_NAME_BASE" generate darwin x64 +generate darwin arm64 generate linux x64 generate windows x64 \ No newline at end of file