Skip to content

Commit dbcb788

Browse files
committed
add actions similar to map2model
1 parent e2b336b commit dbcb788

File tree

6 files changed

+423
-265
lines changed

6 files changed

+423
-265
lines changed

.github/workflows/conda.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build conda packages
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build_wheels:
8+
name: Build wheels on
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
os: ${{ fromJSON(vars.BUILD_OS)}}
14+
python-version: ${{ fromJSON(vars.PYTHON_VERSIONS)}}
15+
steps:
16+
- uses: conda-incubator/setup-miniconda@v3
17+
with:
18+
auto-update-conda: true
19+
python-version: ${{ matrix.python-version }}
20+
21+
- uses: actions/checkout@v4
22+
- name: update submodules
23+
# shell: bash -l {0}
24+
run: |
25+
git submodule update --init --recursive
26+
- name: Conda build
27+
env:
28+
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
29+
shell: bash -l {0}
30+
run: |
31+
conda install -c conda-forge conda-build anaconda-client conda-verify -y
32+
conda install -c conda-forge -c loop3d --file requirements.txt -y
33+
conda build -c anaconda -c conda-forge -c loop3d --output-folder conda conda --python ${{ matrix.python-version }}
34+
anaconda upload --label main conda/*/*.tar.bz2
35+
36+
- name: upload artifacts
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: conda-build-${{matrix.os}}-${{ matrix.python-version }}
40+
path: conda

.github/workflows/integrate.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Container CI
2+
3+
on:
4+
pull_request:
5+
branches: [master]
6+
7+
jobs:
8+
line_endings:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- run: git config --global core.autocrlf false
13+
- run: git config --global core.eol lf
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
workflow_dispatch:
6+
jobs:
7+
release-please:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: GoogleCloudPlatform/release-please-action@v4
11+
id: release
12+
with:
13+
release-type: python
14+
package-name: LoopProjectFile
15+
- name: Debug release_created output
16+
run: |
17+
echo "Release created: ${{ steps.release.outputs.release_created }}"
18+
outputs:
19+
release_created: ${{ steps.release.outputs.release_created }}
20+
21+
pypi:
22+
runs-on: ubuntu-latest
23+
needs: release-please
24+
if: ${{ needs.release-please.outputs.release_created }}
25+
steps:
26+
- name: Trigger build for pypi and upload
27+
run: |
28+
curl -X POST \
29+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
30+
-H "Accept: application/vnd.github.v3+json" \
31+
https://api.github.com/repos/Loop3d/loopprojectfile/actions/workflows/pypi.yml/dispatches \
32+
-d '{"ref":"master"}'
33+
- name: Trigger build for conda and upload
34+
run: |
35+
curl -X POST \
36+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
37+
-H "Accept: application/vnd.github.v3+json" \
38+
https://api.github.com/repos/Loop3d/loopprojectfile/actions/workflows/conda.yml/dispatches \
39+
-d '{"ref":"master"}'

.github/workflows/pypi.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Deploy to PYPI
2+
3+
on:
4+
workflow_dispatch:
5+
jobs:
6+
# build_wheels:
7+
# name: Build wheels on ${{ matrix.os }}
8+
# runs-on: ${{ matrix.os }}
9+
# env:
10+
# CIBW_BUILD: ${{ vars.CIBW_BUILD }}
11+
# strategy:
12+
# matrix:
13+
# os: ${{ fromJSON(vars.BUILD_OS)}}
14+
15+
# steps:
16+
# - uses: actions/checkout@v4
17+
18+
# # Used to host cibuildwheel
19+
# - uses: actions/setup-python@v5
20+
21+
# - name: Install cibuildwheel
22+
# run: python -m pip install cibuildwheel==2.21.2
23+
24+
# - name: build
25+
# run: python -m cibuildwheel --output-dir wheelhouse
26+
# - uses: actions/upload-artifact@v4
27+
# with:
28+
# name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
29+
# path: ./wheelhouse/*.whl
30+
sdist:
31+
name: Build sdist
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
- uses: actions/setup-python@v5
36+
- name: Install dependencies
37+
run: |
38+
python -m pip install --upgrade pip
39+
pip install build
40+
- name: Build sdist
41+
run: python -m build --sdist
42+
- uses: actions/upload-artifact@v4
43+
with:
44+
name: dist
45+
path: ./dist/*.tar.gz
46+
47+
publish:
48+
name: Publish wheels to pypi
49+
runs-on: ubuntu-latest
50+
permissions:
51+
# IMPORTANT: this permission is mandatory for trusted publishing
52+
id-token: write
53+
needs: sdist
54+
steps:
55+
- uses: actions/download-artifact@v4
56+
with:
57+
name: dist
58+
path: dist
59+
- name: copy to wheelhouse
60+
run: |
61+
# cp -r wheelhouse/*/*.whl dist
62+
- uses: pypa/gh-action-pypi-publish@release/v1
63+
with:
64+
skip-existing: true
65+
verbose: true
66+
packages-dir: dist/

0 commit comments

Comments
 (0)