Bump Lucene 9.7.0 (#218) #63
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: Create a release of lmgrep | |
on: | |
push: | |
tags: | |
- 'v*' | |
env: | |
LMGREP_FEATURE_SNOWBALL: true | |
LMGREP_FEATURE_BUNDLED_ANALYZERS: true | |
LMGREP_FEATURE_CHARSETS: true | |
LMGREP_FEATURE_STEMPEL: true | |
LMGREP_FEATURE_RAUDIKKO: false | |
jobs: | |
create-gh-release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3.5.3 | |
- name: Set env | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ env.RELEASE_VERSION }} | |
name: Release ${{ env.RELEASE_VERSION }} | |
body: | | |
See [CHANGELOG.md](https://github.com/dainiusjocas/lucene-grep/blob/main/CHANGELOG.md) for details. | |
If you are using macOS Catalina and later you may need to remove the quarantine attribute from the bits before you can use them. To do this, run the following: | |
``` | |
sudo xattr -r -d com.apple.quarantine lmgrep | |
``` | |
draft: true | |
build-uberjar-upload-to-release-and-store-artifacts: | |
needs: create-gh-release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set env variable with the release version | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- uses: actions/checkout@v3.5.3 | |
- uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: '17.0.7' | |
distribution: 'graalvm' | |
native-image-job-reports: 'true' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install clojure tools-deps` | |
uses: DeLaGuardo/setup-clojure@master | |
with: | |
cli: '1.11.1.1356' | |
bb: '1.3.181' | |
- name: Compile uberjar | |
run: | | |
echo $RELEASE_VERSION > resources/LMGREP_VERSION | |
clojure -T:build prep-deps | |
clojure -Spom | |
clojure -T:build uberjar | |
bb generate-reflection-config | |
cp target/lmgrep.jar target/lmgrep-${RELEASE_VERSION}-standalone.jar | |
- name: Upload uberjar to the release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ env.RELEASE_VERSION }} | |
name: Release ${{ env.RELEASE_VERSION }} | |
draft: true | |
files: | | |
target/lmgrep-*-standalone.jar | |
- name: Archive production artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: uberjar | |
path: | | |
target/lmgrep.jar | |
graalvm/lucene-reflect-config.json | |
resources/LMGREP_VERSION | |
build-native-executables-and-upload-to-release: | |
name: Native image build on ${{ matrix.os }} | |
needs: [ create-gh-release, build-uberjar-upload-to-release-and-store-artifacts ] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ | |
ubuntu-latest, | |
ubuntu-20.04, | |
macos-latest, | |
windows-latest | |
] | |
include: | |
- os: ubuntu-latest | |
platform: linux | |
gu-binary: gu | |
arch: 'amd64' | |
native-image-musl: 'false' | |
static-suffix: '' | |
- os: ubuntu-20.04 | |
platform: linux | |
gu-binary: gu | |
arch: 'amd64' | |
native-image-musl: 'true' | |
static-suffix: '-static' | |
- os: macos-latest | |
platform: macos | |
gu-binary: gu | |
arch: 'amd64' | |
native-image-musl: 'false' | |
static-suffix: '' | |
- os: windows-latest | |
platform: windows | |
gu-binary: gu.exe | |
arch: 'amd64' | |
native-image-musl: 'false' | |
static-suffix: '' | |
- os: self-hosted | |
platform: macos | |
gu-binary: gu | |
arch: 'aarch64' | |
native-image-musl: 'false' | |
static-suffix: '' | |
steps: | |
- name: Set env variable with the release version | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- uses: actions/checkout@v3.5.3 | |
- uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: '17.0.7' | |
distribution: 'graalvm' | |
native-image-job-reports: 'true' | |
native-image-musl: ${{ matrix.native-image-musl }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Download uberjar from job 'build-uberjar-upload-to-release-and-store-artifacts' | |
uses: actions/download-artifact@v3 | |
with: | |
name: uberjar | |
- name: Build native-image on *nix | |
env: | |
LMGREP_STATIC: ${{ matrix.native-image-musl }} | |
LMGREP_MUSL: ${{ matrix.native-image-musl }} | |
run: | | |
./script/compile | |
zip lmgrep-${RELEASE_VERSION}-${{ matrix.platform }}-${{ matrix.arch }}${{ matrix.static-suffix }}.zip lmgrep | |
if: runner.os != 'Windows' | |
- name: Build native-image on Windows and zip it | |
run: | | |
native-image.cmd -jar "target/lmgrep.jar" -H:+AddAllCharsets -H:IncludeResources=LMGREP_VERSION -H:Name=lmgrep -H:+ReportExceptionStackTraces --initialize-at-build-time --verbose --no-fallback -H:ReflectionConfigurationFiles=graalvm/lucene-reflect-config.json -J-Xmx8g | |
tar.exe -a -c -f lmgrep-$env:GITHUB_REF_NAME-${{ matrix.platform }}-${{ matrix.arch }}.zip lmgrep.exe | |
if: runner.os == 'Windows' | |
- name: Upload binaries to the release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ env.RELEASE_VERSION }} | |
name: Release ${{ env.RELEASE_VERSION }} | |
draft: true | |
files: | | |
lmgrep-*-${{ matrix.platform }}-${{ matrix.arch }}${{ matrix.static-suffix }}.zip | |
- name: Archive static native images as artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: static-image | |
path: lmgrep | |
if: matrix.native-image-musl == 'true' | |
docker-image-release: | |
needs: [ create-gh-release, build-uberjar-upload-to-release-and-store-artifacts, build-native-executables-and-upload-to-release ] | |
name: docker image release per architecture | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3.5.3 | |
- name: Set env variable with the release version | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Download uberjar from job 'build-native-executables-and-upload-to-release' | |
uses: actions/download-artifact@v3 | |
with: | |
name: static-image | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: dainiusjocas/lmgrep | |
tags: | | |
type=raw,value=latest | |
type=raw,value=${{ env.RELEASE_VERSION }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
push: true | |
context: . | |
file: Dockerfile.deploy | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |