forked from spudde123/SC2MapAnalysis
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (69 loc) · 2.44 KB
/
build_c_extension.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
name: BuildCExtension
on:
push:
branches: [ master, develop ]
jobs:
build:
name: Build release
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
python-version: ['3.10', '3.11', '3.12']
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Install poetry
run: pipx install poetry
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install requirements and build extension
run: |
poetry install --with dev
python -c "import shutil, glob, os; [shutil.copy(f, '.') for f in glob.glob('mapanalyzerext*') if not os.path.exists(os.path.join('.', os.path.basename(f)))]"
- name: Upload the artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}_python${{ matrix.python-version }}
path: ./mapanalyzerext*
commit:
name: Commit all binaries
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Download all artifacts
uses: actions/download-artifact@v3
with:
path: ./artifacts/
- name: List downloaded files (debugging)
run: ls -R ./artifacts/
- name: Move binaries to correct directory
run: |
mkdir -p ./map_analyzer/cext/
mv ./artifacts/* ./map_analyzer/cext/
- name: Move files from subdirectories to /map_analyzer/cext/ and remove folders
run: |
find ./map_analyzer/cext/ -mindepth 2 -type f -exec mv -t ./map_analyzer/cext/ {} +
find ./map_analyzer/cext/ -type d -empty -delete
- name: List moved files (debugging)
run: ls -R ./map_analyzer/cext/
- name: Configure Git
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
- name: Commit all binaries
run: |
git add ./map_analyzer/cext/*
git status
git commit -m "Add all binaries for multiple platforms and Python versions" || echo "No changes to commit"
git push origin ${{ github.ref }}