-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (84 loc) · 3.1 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
90
91
92
93
94
name: CI
on:
push:
branches: [ "index-on-ci" ] # FIXME
jobs:
# indexing:
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v4
#
# - 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: IJ build shared indexes
# run: |
# mkdir -p workspace/project-indexes
# intellij-idea-community dump-shared-index project --project-id=multi-jar --project-dir=examples/multi-jar --output=workspace/project-indexes
#
# - name: Set up JDK 11
# uses: actions/setup-java@v4
# with:
# java-version: '11'
# distribution: 'temurin'
# cache: 'sbt'
# - name: IJ build cdn structure
# run: sbt 'runMain com.virtuslab.shared_indexes.Main project'
#
# - name: IJ check indexes
# run: ls -lh workspace/cdn
#
# - name: Archive index artifacts
# uses: actions/upload-artifact@v3
# with:
# name: index-assets
# path: workspace/cdn
# if-no-files-found: error
release:
# needs: indexing
runs-on: ubuntu-latest
steps:
- name: Set TAG and RELEASE_URL
run: |
echo "TAG=$(cat .github/release-tag)" >> $GITHUB_ENV
echo "RELEASE_URL=https://github.com/${GITHUB_REPOSITORY}/releases/${TAG}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Download Artifacts
run: |
mkdir -p indexing-results/data/project/multi-jar
mkdir -p indexing-results/project/multi-jar
echo "list.json" > indexing-results/project/list.json.xz
echo "index.json" > indexing-results/project/multi-jar/index.json.xz
echo "index.ijx" > indexing-results/data/project/multi-jar/1234567.ijx.xz
echo "metadata.json" > indexing-results/data/project/multi-jar/1234567.metadata.json
echo "sha.256" > indexing-results/data/project/multi-jar/1234567.sha256
# uses: actions/download-artifact@v3
# with:
# name: index-assets
# path: indexing-results
- name: IJ check indexes
run: ls -lhR indexing-results
- name: IJ check indexes
run: ls -lhR .
- name: Swap data url in index.json.xz
run: |
PATH_TO_INDEX_FILE=(indexing-results/data/project/multi-jar/*.ijx.xz)
.github/scripts/swap-index-url.sh $PATH_TO_INDEX_FILE "$RELEASE_URL/$(basename "$PATH_TO_INDEX_FILE")"
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: $TAG
draft: true
prerelease: false
files: |
indexing-results/project/list.json.xz
indexing-results/project/multi-jar/index.json.xz
indexing-results/data/project/multi-jar/*.ijx.xz
indexing-results/data/project/multi-jar/*.metadata.json
indexing-results/data/project/multi-jar/*.sha256