Skip to content

Commit

Permalink
python, node, deno, new distribution, updated deps
Browse files Browse the repository at this point in the history
  • Loading branch information
asg017 committed Mar 28, 2023
1 parent 029550d commit aa0f5f6
Show file tree
Hide file tree
Showing 60 changed files with 1,988 additions and 167 deletions.
43 changes: 0 additions & 43 deletions .github/workflows/release.js

This file was deleted.

235 changes: 188 additions & 47 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,68 +6,209 @@ on:
permissions:
contents: read
jobs:
build-macos:
name: Release for MacOS
runs-on: macos-latest
build-linux_x86-extension:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Release
env:
SKIP_NET: "1"
run: |
mkdir -p dist/
make test-loadable
- name: Upload dist as artifact
uses: actions/upload-artifact@v2
with:
name: http0-darwin-amd64
path: dist
build-linux:
name: Release for Linux
runs-on: ubuntu-latest
# 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.17
uses: actions/setup-go@v1
with:
go-version: 1.17
- run: make loadable
- uses: actions/upload-artifact@v3
with:
name: sqlite-http-linux_x86
path: dist/http0.so
build-linux_x86-python:
runs-on: ubuntu-20.04
needs: [build-linux_x86-extension]
steps:
- uses: actions/checkout@v3
- name: Download workflow artifacts
uses: actions/download-artifact@v3
with:
name: sqlite-http-linux_x86
path: dist/
- uses: actions/setup-python@v3
- run: pip install wheel
- run: make python
- run: make datasette
- uses: actions/upload-artifact@v3
with:
name: sqlite-http-linux_x86-wheels
path: dist/wheels/*.whl

build-macos-extension:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Release
env:
SKIP_NET: "1"
run: |
mkdir -p dist/
make test-loadable
- name: Upload dist as artifact
uses: actions/upload-artifact@v2
with:
name: http0-linux-amd64
path: dist
build-windows:
name: Release for Windows
runs-on: windows-2022
# 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.17
uses: actions/setup-go@v1
with:
go-version: 1.17
- run: make loadable
- uses: actions/upload-artifact@v3
with:
name: sqlite-http-macos
path: dist/http0.dylib
build-macos-python:
runs-on: macos-latest
needs: [build-macos-extension]
steps:
- uses: actions/checkout@v3
- name: Download workflow artifacts
uses: actions/download-artifact@v3
with:
name: sqlite-http-macos
path: dist/
- uses: actions/setup-python@v3
- run: pip install wheel
- run: make python
- run: make datasette
- uses: actions/upload-artifact@v3
with:
name: sqlite-http-macos-wheels
path: dist/wheels/*.whl

build-windows-extension:
name: Building windows extension
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Release
env:
SKIP_NET: "1"
run: |
mkdir -p dist/
make test-loadable
- name: Upload dist as artifact
uses: actions/upload-artifact@v2
with:
name: http0-windows-amd64
path: dist
release:
name: "releases"
if: ${{ github.event_name == 'release' }}
needs: [build-macos, build-linux, build-windows]
# 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.17
uses: actions/setup-go@v1
with:
go-version: 1.17
- run: make loadable
- uses: actions/upload-artifact@v3
with:
name: sqlite-http-windows
path: dist/http0.dll
build-windows-python:
runs-on: windows-latest
needs: [build-windows-extension]
steps:
- uses: actions/checkout@v3
- name: Download workflow artifacts
uses: actions/download-artifact@v3
with:
name: sqlite-http-windows
path: dist/
- uses: actions/setup-python@v3
- run: pip install wheel
- run: make python
- run: make datasette
- uses: actions/upload-artifact@v3
with:
name: sqlite-http-windows-wheels
path: dist/wheels/*.whl
upload-extensions:
name: Upload release assets
needs:
[
build-macos-extension,
build-linux_x86-extension,
build-windows-extension,
]
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download workflow artifacts
uses: actions/download-artifact@v2
- run: npm install tar-fs
- uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const script = require('.github/workflows/release.js')
const script = require('.github/workflows/upload.js')
await script({github, context})
upload-deno:
name: Upload Deno release assets
needs:
[
build-macos-extension,
build-linux_x86-extension,
build-windows-extension,
]
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download workflow artifacts
uses: actions/download-artifact@v2
- uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const script = require('.github/workflows/upload-deno-assets.js')
await script({github, context})
upload-npm:
needs:
[
build-macos-extension,
build-linux_x86-extension,
build-windows-extension,
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download workflow artifacts
uses: actions/download-artifact@v2
- run: |
cp sqlite-http-linux_x86/http0.so npm/sqlite-http-linux-x64/lib/http0.so
cp sqlite-http-macos/http0.dylib npm/sqlite-http-darwin-x64/lib/http0.dylib
cp sqlite-http-windows/http0.dll npm/sqlite-http-windows-x64/lib/http0.dll
- name: Install node
uses: actions/setup-node@v3
with:
node-version: "16"
registry-url: "https://registry.npmjs.org"
- name: Publish NPM sqlite-http-linux-x64
working-directory: npm/sqlite-http-linux-x64
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish NPM sqlite-http-darwin-x64
working-directory: npm/sqlite-http-darwin-x64
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
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish NPM sqlite-http
working-directory: npm/sqlite-http
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
upload_pypi:
needs: [build-linux_x86-python, build-macos-python, build-windows-python]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: sqlite-http-windows-wheels
path: dist
- uses: actions/download-artifact@v3
with:
name: sqlite-http-linux_x86-wheels
path: dist
- uses: actions/download-artifact@v3
with:
name: sqlite-http-macos-wheels
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true
Loading

0 comments on commit aa0f5f6

Please sign in to comment.