-
Notifications
You must be signed in to change notification settings - Fork 14
56 lines (47 loc) · 1.72 KB
/
plugin-repo.yml
File metadata and controls
56 lines (47 loc) · 1.72 KB
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
name: Generate Plugin Repository Entry
on:
release:
types: [published]
jobs:
generate-plugin-repo:
name: Generate Plugin Repository YAML
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install PyYAML requests
- name: Download release assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mkdir -p dist
# Download all release assets
gh release download ${{ github.event.release.tag_name }} -D dist/
- name: Generate plugin repository YAML
env:
GITHUB_REF_NAME: ${{ github.event.release.tag_name }}
run: python3 .github/workflows/generate_plugin_repo.py $GITHUB_REF_NAME
- name: Upload plugin repository files to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.event.release.tag_name }} plugin-repo-entry.yml plugin-repo-summary.txt
- name: Create PR to plugin repository (optional)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Plugin repository entry generated!"
echo "To submit to CF CLI plugin repository:"
echo "1. Fork https://github.com/cloudfoundry-incubator/cli-plugin-repo"
echo "2. Add the contents of plugin-repo-entry.yml to repo-index.yml"
echo "3. Create a pull request"
echo ""
echo "Entry content:"
cat plugin-repo-entry.yml