Narek/bm25 bloom #1182
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: build | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
pull_request: | |
branches: | |
- main | |
- dev | |
workflow_dispatch: | |
inputs: | |
create_release: | |
type: boolean | |
description: "Create GitHub release for current version" | |
required: false | |
default: false | |
jobs: | |
build_lantern: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-22.04, ubicloud-standard-4-arm, macos-13] | |
postgres: [12, 13, 14, 15, 16, 17] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
- name: Build | |
id: build | |
run: sudo sh -c "PG_VERSION=$PG_VERSION USE_SOURCE=1 GITHUB_OUTPUT=$GITHUB_OUTPUT BUILD_PACKAGES=1 USE_SSL=1 ./ci/scripts/build.sh" | |
env: | |
PG_VERSION: ${{ matrix.postgres }} | |
- name: Create Archive Package | |
id: archive | |
run: sudo sh -c "GITHUB_OUTPUT=$GITHUB_OUTPUT ./ci/scripts/package-archive.sh" | |
- name: Upload deb package artifacts | |
uses: actions/upload-artifact@v4 | |
if: ${{ steps.build.outputs.deb_package_path != '' && github.event_name == 'workflow_dispatch' && inputs.create_release }} | |
with: | |
name: ${{ steps.build.outputs.deb_package_name }} | |
path: ${{ steps.build.outputs.deb_package_path }} | |
- name: Upload archive package artifacts | |
uses: actions/upload-artifact@v4 | |
if: ${{ steps.archive.outputs.archive_package_path != '' && github.event_name == 'workflow_dispatch' && inputs.create_release }} | |
with: | |
name: ${{ steps.archive.outputs.archive_package_name }} | |
path: ${{ steps.archive.outputs.archive_package_path }} | |
build_extras: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-22.04, ubicloud-standard-4-arm, macos-13] | |
postgres: [12, 13, 14, 15, 16, 17] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
- name: Build | |
id: build | |
run: sudo sh -c "PG_VERSION=$PG_VERSION SETUP_ENV=1 USE_SOURCE=1 SETUP_POSTGRES=1 PACKAGE_EXTENSION=1 GITHUB_OUTPUT=$GITHUB_OUTPUT ./ci/scripts/build-extras.sh" | |
env: | |
PG_VERSION: ${{ matrix.postgres }} | |
- name: Build Lantern CLI | |
id: build_cli | |
run: sudo sh -c "PACKAGE_CLI=1 GITHUB_OUTPUT=$GITHUB_OUTPUT ./ci/scripts/build-extras.sh" | |
if: ${{ matrix.postgres == 17 }} # run only once | |
- name: Upload archive package artifacts | |
if: ${{ github.event_name == 'workflow_dispatch' && inputs.create_release }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ steps.build.outputs.archive_package_name }} | |
path: ${{ steps.build.outputs.archive_package_path }} | |
- name: Upload Lantern CLI artifacts | |
if: ${{ matrix.postgres == 17 && github.event_name == 'workflow_dispatch' && inputs.create_release }} # run only once | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ steps.build_cli.outputs.cli_package_name }} | |
path: ${{ steps.build_cli.outputs.cli_package_path }} | |
package: | |
runs-on: ubuntu-22.04 | |
needs: [build_lantern, build_extras] | |
if: ${{ github.event_name == 'workflow_dispatch' && inputs.create_release }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: lantern-extras-*.tar | |
merge-multiple: true | |
path: /tmp/lantern-extras-package | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: lantern-cli-* | |
merge-multiple: true | |
path: /tmp/lantern-cli-package | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: lantern-*.tar | |
merge-multiple: true | |
path: /tmp/lantern-package | |
- name: Create universal package | |
id: package | |
run: sudo sh -c "GITHUB_OUTPUT=$GITHUB_OUTPUT PACKAGE_EXTRAS=1 GITHUB_TOKEN=$GITHUB_TOKEN ./ci/scripts/universal-package.sh" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ steps.package.outputs.package_name }} | |
path: ${{ steps.package.outputs.package_path }} | |
- name: Create source code archive with submodules | |
run: | | |
find ./ -name '.git*' -exec rm -r {} \; || true | |
tar -czf /tmp/lantern-v${{ steps.package.outputs.package_version }}-source.tar.gz . | |
- name: Create GitHub release | |
uses: softprops/action-gh-release@v2 | |
id: create_release | |
with: | |
name: Lantern v${{ steps.package.outputs.package_version }} | |
tag_name: v${{ steps.package.outputs.package_version }} | |
files: | | |
${{ steps.package.outputs.package_path }} | |
/tmp/lantern-v${{ steps.package.outputs.package_version }}-source.tar.gz | |
/tmp/lantern-cli-package/* | |
generate_release_notes: true | |
- name: Homebrew release | |
uses: var77/bump-homebrew-formula-action@main | |
with: | |
formula-name: lantern | |
formula-path: Formula/lantern.rb | |
tag-name: v${{ steps.package.outputs.package_version }} | |
download-url: https://github.com/lanterndata/lantern/releases/download/v${{ steps.package.outputs.package_version }}/lantern-v${{ steps.package.outputs.package_version }}-source.tar.gz | |
homebrew-tap: lanterndata/homebrew-lantern | |
commit-message: | | |
{{formulaName}} {{version}} | |
base-branch: main | |
env: | |
COMMITTER_TOKEN: ${{ secrets.HOMEBREW_COMMITTER_TOKEN }} |