-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (61 loc) · 1.89 KB
/
build.yml
File metadata and controls
74 lines (61 loc) · 1.89 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Build and Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
# branches: ["main"]
jobs:
build:
name: Building Python Tools ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
artifact_name: python-env-windows.zip
# - os: macos-13 # Intel Mac (x64)
# artifact_name: python-env-macos-x64.tar.gz
- os: macos-latest
artifact_name: python-env-macos-arm64.tar.gz
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: "3.10"
activate-environment: ogs_python_tools
environment-file: environment.yml
channels: conda-forge,nodefaults
- name: Install Requirements
shell: bash -el {0}
run: conda install -n base -c conda-forge conda-pack mamba -y
- name: Cleanup Environment
shell: bash -el {0}
run: |
conda clean --all -y
pip cache purge
- name: Pack Environment
shell: bash -el {0}
run: conda run -n base conda-pack -n ogs_python_tools -o ${{ matrix.artifact_name }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: ${{ matrix.artifact_name }}
release:
name: Create Release
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
needs: build
runs-on: ubuntu-latest
steps:
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: artifacts/**/*
generate_release_notes: true