Index project and release shared indexes #35
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: Index project and release shared indexes | |
on: | |
workflow_dispatch: | |
inputs: | |
project-name: | |
description: 'The name of the project to index and release' | |
required: true | |
type: string | |
env: | |
ARTIFACT_NAME: "index-assets" | |
DOWNLOADED_ARTIFACTS: "indexing-results" | |
jobs: | |
indexing: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
cache: 'sbt' | |
- name: Generate full-project if requested | |
if: ${{ inputs.project-name == 'full-project' }} | |
run: sbt 'runMain com.virtuslab.example.generator.FullProjectGenerator' | |
- name: Install IJ | |
run: sudo snap install intellij-idea-community --channel=2023.3/stable --classic | |
- name: IJ install Shared Indexes plugin | |
run: intellij-idea-community installPlugins intellij.indexing.shared | |
- name: Build shared indexes and cdn structure | |
run: sbt "runMain com.virtuslab.shared_indexes.Main project --inputs=examples/${{ inputs.project-name }} --idea-binary /snap/bin/intellij-idea-community --index-server-url=https://github.com/${GITHUB_REPOSITORY}/releases/download/${{ inputs.project-name }}" | |
- name: Check indexes | |
run: find workspace/cdn -type f -exec du -h {} + | |
- name: Archive index artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.ARTIFACT_NAME }} | |
path: workspace/cdn | |
if-no-files-found: error | |
release: | |
needs: indexing | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set RELEASE_URL | |
run: echo "RELEASE_URL=https://github.com/${GITHUB_REPOSITORY}/releases/download/${{ inputs.project-name }}" >> $GITHUB_ENV | |
- uses: actions/download-artifact@v3 | |
with: | |
name: ${{ env.ARTIFACT_NAME }} | |
path: ${{ env.DOWNLOADED_ARTIFACTS }} | |
- name: Check indexes | |
run: find "${{ env.DOWNLOADED_ARTIFACTS }}" -type f -exec du -h {} + | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ inputs.project-name }} | |
draft: true | |
prerelease: false | |
fail_on_unmatched_files: true | |
files: | | |
${{ env.DOWNLOADED_ARTIFACTS }}/project/list.json.xz | |
${{ env.DOWNLOADED_ARTIFACTS }}/project/${{ inputs.project-name }}/index.json.xz | |
${{ env.DOWNLOADED_ARTIFACTS }}/data/project/${{ inputs.project-name }}/*.ijx.xz | |
${{ env.DOWNLOADED_ARTIFACTS }}/data/project/${{ inputs.project-name }}/*.metadata.json | |
${{ env.DOWNLOADED_ARTIFACTS }}/data/project/${{ inputs.project-name }}/*.sha256 |