Skip to content

Lucene snapshots

Lucene snapshots #7

# This workflow will check out, build, and publish snapshots of lucene.
name: Lucene snapshots
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
ref:
description:
required: false
default: 'main'
jobs:
publish-snapshots:
if: github.repository == 'lucenia/snapshots'
runs-on: ubuntu-latest
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Cat settings.xml
run: cat ~/.m2/settings.xml
- name: Checkout build repo
uses: actions/checkout@v4
with:
repository: lucenia/build
ref: main
path: lucenia-build
- name: Copy settings.xml
run: |
cp lucenia-build/maven/settings.xml ~/.m2/
cat ~/.m2/settings.xml
- name: Checkout Lucene
uses: actions/checkout@v4
with:
repository: 'apache/lucene'
path: lucene
ref: ${{ github.event.inputs.ref }}
- name: Set hash
working-directory: ./lucene
run: |
echo "REVISION=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
id: version
- name: Initialize gradle settings
working-directory: ./lucene
run: ./gradlew localSettings
- name: Publish Lucene to local maven repo.
working-directory: ./lucene
run: ./gradlew publishJarsPublicationToMavenLocal -Pversion.suffix=snapshot-${{ steps.version.outputs.REVISION }}
- name: Publish lucene snapshot to github packages
env:
USERNAME: ${{ github.actor }}
ACCESS_TOKEN: ${{ github.token }}
run: |
bash lucenia-build/scripts/gradle/publish-to-github-packages.sh ~/.m2/repository/ lucenia snapshots github