v0.1.0-alpha.7 #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "release" | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
build-linux_x86-extension: | |
runs-on: ubuntu-20.04 | |
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: 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 | |
# 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: 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 | |
# 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: 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 | |
- uses: actions/download-artifact@v2 | |
- uses: asg017/upload-spm@main | |
id: upload-spm | |
with: | |
name: sqlite-http | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
platforms: | | |
linux-x86_64: sqlite-http-linux_x86/* | |
macos-x86_64: sqlite-http-macos/* | |
windows-x86_64: sqlite-http-windows/* | |
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 | |
upload-gem: | |
needs: | |
[ | |
build-macos-extension, | |
build-linux_x86-extension, | |
build-windows-extension, | |
] | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/download-artifact@v2 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.2 | |
- run: | | |
rm bindings/ruby/lib/*.{dylib,so,dll} || true | |
cp sqlite-http-linux_x86/*.so bindings/ruby/lib | |
gem -C bindings/ruby build -o ${{ env.PLATFORM }}.gem sqlite_http.gemspec | |
env: | |
PLATFORM: x86_64-linux | |
- run: | | |
rm bindings/ruby/lib/*.{dylib,so,dll} || true | |
cp sqlite-http-macos/*.dylib bindings/ruby/lib | |
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-windows/*.dll bindings/ruby/lib | |
gem -C bindings/ruby build -o ${{ env.PLATFORM }}.gem sqlite_http.gemspec | |
env: | |
PLATFORM: x64-mingw32 | |
- run: | | |
gem push bindings/ruby/x86_64-linux.gem | |
gem push bindings/ruby/x86_64-darwin.gem | |
gem push bindings/ruby/x64-mingw32.gem | |
env: | |
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }} |