-
Notifications
You must be signed in to change notification settings - Fork 3
59 lines (48 loc) · 1.81 KB
/
Copy pathaction.yml
File metadata and controls
59 lines (48 loc) · 1.81 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
57
58
59
name: ruiching-sdk-index
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.10.12
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
pip install requests urllib3
- name: Check Script Existence
id: check_merge_sdk_script
run: |
if [ -f "$GITHUB_WORKSPACE/scripts/merge_sdk.py" ]; then
echo "script_exists=true" >> $GITHUB_ENV
else
echo "script_exists=false" >> $GITHUB_ENV
fi
- name: Update-Github-Sdk-Index
if: ${{ github.repository == 'RT-Thread-Studio/ruiching-sdk-index' && github.ref == 'refs/heads/main' && github.event_name == 'push' && env.script_exists == 'true' }}
run: |
cd ${{ github.workspace }}/scripts
python merge_sdk.py
- name: Check Packages Mirror Script Existence
id: check_packages_mirror_script
run: |
if [ -f "$GITHUB_WORKSPACE/scripts/packages_mirror.py" ]; then
echo "script_exists=true" >> $GITHUB_ENV
else
echo "script_exists=false" >> $GITHUB_ENV
fi
- name: Update-Gogs-Packages-Mirror
if: ${{ github.repository == 'RT-Thread-Studio/ruiching-sdk-index' && github.ref == 'refs/heads/main' && github.event_name == 'push' && env.script_exists == 'true' }}
env:
GOGS_URL: ${{ secrets.GOGS_URL }}
GOGS_TOKEN: ${{ secrets.GOGS_TOKEN }}
GITHUB_PROXY_URL: ${{ secrets._GITHUB_PROXY_URL }}
run: |
cd ${{ github.workspace }}/scripts
python packages_mirror.py