-
Notifications
You must be signed in to change notification settings - Fork 44
63 lines (60 loc) · 1.67 KB
/
build_wheel.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
name: build wheel
on:
push:
branches:
- main
# Release branches
- "[0-9]+.[0-9]+.x"
tags:
- '*'
pull_request:
branches:
- main
- "[0-9]+.[0-9]+.x"
jobs:
build_wheel:
name: Build wheel
runs-on: ubuntu-latest
steps:
- name: Using ref ${{ github.ref }}
run: echo "${{ github.ref }}"
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: python -m pip install --upgrade build
- name: Insert Git hash into version
run: .github/scripts/insert_git_hash.sh src/gurobi_ml/_version.py
- name: Build wheel
run: python -m build
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
path: dist/*
if-no-files-found: error
upload_conda:
name: Upload to Conda staging
runs-on: ubuntu-latest
needs: build_wheel
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/quick2')
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: dist
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: python -m pip install --upgrade twine
- name: Twine check
run: python -m twine check dist/artifact/*
- name: Upload to staging
env:
ANACONDA_STAGING_TOKEN: ${{ secrets.ANACONDA_STAGING_TOKEN }}
run:
bash .github/scripts/upload_anaconda.sh