Skip to content

Commit

Permalink
add lucene snapshot workflow
Browse files Browse the repository at this point in the history
Workflow to build lucene snapshots and publish them to github packages.

Signed-off-by: Nicholas Walter Knize <[email protected]>
  • Loading branch information
nknize committed Feb 15, 2024
1 parent 01122ac commit 70b6351
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/lucene-snapshots.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# 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: 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: 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/
- name: Publish lucene snapshot to github packages
env:
USERNAME: ${{github.actor}}
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
bash lucenia-build/scripts/gradle/publish-to-github-packages.sh ~/.m2/repository/ lucenia-bot snapshots github

0 comments on commit 70b6351

Please sign in to comment.