-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (72 loc) · 3.07 KB
/
install-index-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
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
run: |
mkdir -p workspace/project-indexes
intellij-idea-community dump-shared-index project --project-id=${{ inputs.project-name }} --project-dir=examples/${{ inputs.project-name }} --output=workspace/project-indexes
- name: Build cdn structure
run: sbt 'runMain com.virtuslab.shared_indexes.Main project'
- 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: Swap data url in index.json.xz
run: |
PATH_TO_INDEX_FILE=(${{ env.DOWNLOADED_ARTIFACTS }}/data/project/${{ inputs.project-name }}/*.ijx.xz)
.github/scripts/swap-index-url.sh "${{ env.DOWNLOADED_ARTIFACTS }}/project/${{ inputs.project-name }}/index.json.xz" "${{ env.RELEASE_URL }}/$(basename "$PATH_TO_INDEX_FILE")"
- 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