-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workflow to build lucene snapshots and publish them to github packages. Signed-off-by: Nicholas Walter Knize <[email protected]>
- Loading branch information
Showing
1 changed file
with
68 additions
and
0 deletions.
There are no files selected for viewing
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
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 |