v0.2.4-alpha.1 #24
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-ubuntu-extension: | |
name: Build ubuntu | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- run: make loadable-release | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: sqlite-regex-ubuntu | |
path: dist/release/regex0.so | |
build-ubuntu-python: | |
runs-on: ubuntu-20.04 | |
needs: [build-ubuntu-extension] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download workflow artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: sqlite-regex-ubuntu | |
path: dist/release/ | |
- uses: actions/setup-python@v3 | |
- run: pip install wheel | |
- run: make python-release | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: sqlite-regex-ubuntu-wheels | |
path: dist/release/wheels/*.whl | |
build-macos-extension: | |
name: Build macos-latest | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- run: make loadable-release | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: sqlite-regex-macos | |
path: dist/release/regex0.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-regex-macos | |
path: dist/release/ | |
- uses: actions/setup-python@v3 | |
- run: pip install wheel | |
- run: make python-release | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: sqlite-regex-macos-wheels | |
path: dist/release/wheels/*.whl | |
build-macos-arm-extension: | |
name: Build macos-latest with arm | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- run: rustup target add aarch64-apple-darwin | |
- run: make loadable-release target=aarch64-apple-darwin | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: sqlite-regex-macos-arm | |
path: dist/release/regex0.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-regex-macos-arm | |
path: dist/release/ | |
- uses: actions/setup-python@v3 | |
- run: pip install wheel | |
- run: make python-release IS_MACOS_ARM=1 | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: sqlite-regex-macos-arm-wheels | |
path: dist/release/wheels/*.whl | |
build-windows-extension: | |
name: Build windows-latest | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- run: make loadable-release | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: sqlite-regex-windows | |
path: dist/release/regex0.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-regex-windows | |
path: dist/release/ | |
- uses: actions/setup-python@v3 | |
- run: pip install wheel | |
- run: make python-release | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: sqlite-regex-windows-wheels | |
path: dist/release/wheels/*.whl | |
build-datasette-sqlite-utils: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
- run: pip install wheel build | |
- run: make datasette-release sqlite-utils-release | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: sqlite-regex-datasette-sqlite-utils-wheels | |
path: dist/release/wheels/*.whl | |
upload-crate: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- run: cargo publish | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
upload-extensions: | |
name: Upload release assets | |
needs: | |
[ | |
build-macos-extension, | |
build-macos-arm-extension, | |
build-ubuntu-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-regex | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
platforms: | | |
linux-x86_64: sqlite-regex-ubuntu/* | |
macos-x86_64: sqlite-regex-macos/* | |
macos-aarch64: sqlite-regex-macos-arm/* | |
windows-x86_64: sqlite-regex-windows/* | |
upload-deno: | |
name: Upload Deno release assets | |
needs: | |
[ | |
build-macos-extension, | |
build-macos-arm-extension, | |
build-ubuntu-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-macos-arm-extension, | |
build-ubuntu-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-regex-ubuntu/regex0.so npm/sqlite-regex-linux-x64/lib/regex0.so | |
cp sqlite-regex-macos/regex0.dylib npm/sqlite-regex-darwin-x64/lib/regex0.dylib | |
cp sqlite-regex-macos-arm/regex0.dylib npm/sqlite-regex-darwin-arm64/lib/regex0.dylib | |
cp sqlite-regex-windows/regex0.dll npm/sqlite-regex-windows-x64/lib/regex0.dll | |
- name: Install node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "16" | |
registry-url: "https://registry.npmjs.org" | |
- name: Publish NPM sqlite-regex-linux-x64 | |
working-directory: npm/sqlite-regex-linux-x64 | |
run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish NPM sqlite-regex-darwin-x64 | |
working-directory: npm/sqlite-regex-darwin-x64 | |
run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish NPM sqlite-regex-darwin-arm64 | |
working-directory: npm/sqlite-regex-darwin-arm64 | |
run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish NPM sqlite-regex-windows-x64 | |
working-directory: npm/sqlite-regex-windows-x64 | |
run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish NPM sqlite-regex | |
working-directory: npm/sqlite-regex | |
run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
upload-gem: | |
needs: | |
[ | |
build-macos-extension, | |
build-macos-arm-extension, | |
build-ubuntu-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-regex-macos/*.dylib bindings/ruby/lib | |
gem -C bindings/ruby build -o x86_64-darwin.gem sqlite_regex.gemspec | |
env: | |
PLATFORM: x86_64-darwin | |
- run: | | |
rm bindings/ruby/lib/*.{dylib,so,dll} || true | |
cp sqlite-regex-macos-arm/*.dylib bindings/ruby/lib | |
gem -C bindings/ruby build -o arm64-darwin.gem sqlite_regex.gemspec | |
env: | |
PLATFORM: arm64-darwin | |
- run: | | |
rm bindings/ruby/lib/*.{dylib,so,dll} || true | |
cp sqlite-regex-ubuntu/*.so bindings/ruby/lib | |
gem -C bindings/ruby build -o x86_64-linux.gem sqlite_regex.gemspec | |
env: | |
PLATFORM: x86_64-linux | |
- run: | | |
rm bindings/ruby/lib/*.{dylib,so,dll} || true | |
cp sqlite-regex-windows/*.dll bindings/ruby/lib | |
gem -C bindings/ruby build -o ${{ env.PLATFORM }}.gem sqlite_regex.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/arm64-darwin.gem | |
gem push bindings/ruby/x64-mingw32.gem | |
env: | |
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }} | |
upload-pypi: | |
needs: | |
[ | |
build-ubuntu-python, | |
build-macos-python, | |
build-macos-arm-python, | |
build-windows-python, | |
build-datasette-sqlite-utils, | |
] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: sqlite-regex-windows-wheels | |
path: dist | |
- uses: actions/download-artifact@v3 | |
with: | |
name: sqlite-regex-ubuntu-wheels | |
path: dist | |
- uses: actions/download-artifact@v3 | |
with: | |
name: sqlite-regex-macos-wheels | |
path: dist | |
- uses: actions/download-artifact@v3 | |
with: | |
name: sqlite-regex-macos-arm-wheels | |
path: dist | |
- uses: actions/download-artifact@v3 | |
with: | |
name: sqlite-regex-datasette-sqlite-utils-wheels | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
skip_existing: true |