-
Notifications
You must be signed in to change notification settings - Fork 43
62 lines (57 loc) · 2.03 KB
/
build.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
name: build
on:
release:
types: [ released ]
pull_request:
workflow_dispatch:
defaults:
run:
shell: micromamba-shell {0}
jobs:
build:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1
with:
upload_to_pypi: ${{ (github.event_name == 'release') && (github.event.action == 'released') }}
secrets:
pypi_token: ${{ secrets.PYPI_PASSWORD_STSCI_MAINTAINER }}
freeze:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
[ "ubuntu-latest", "macos-latest" ]
python-version:
[ "3.11", "3.12" ]
fail-fast: false
name: freeze versions (Python ${{ matrix.python-version }}, ${{ matrix.os }})
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: mamba-org/setup-micromamba@v1
with:
environment-name: jwql-${{ runner.os }}-py${{ matrix.python-version }}
environment-file: environment.yml
create-args: >-
python=${{ matrix.python-version }}
conda
init-shell: none
generate-run-shell: true
- run: pip install .
- run: pip list
- id: version
uses: mtkennerly/dunamai-action@v1
with:
args: --strict --pattern "default-unprefixed" --style semver
- id: filename
run: echo "filename=jwql_${{ steps.version.outputs.version }}_conda_${{ runner.os }}_${{ runner.arch }}_py${{ matrix.python-version }}.yml" >> $GITHUB_OUTPUT
- run: conda env export --no-build | grep -v "name:" | grep -v "prefix:" > ${{ steps.filename.outputs.filename }}
- run: cat ${{ steps.filename.outputs.filename }}
- uses: actions/upload-artifact@v4
with:
name: ${{ steps.filename.outputs.filename }}
path: ${{ steps.filename.outputs.filename }}
- if: (github.event_name == 'release' && github.event.action == 'released')
uses: svenstaro/upload-release-action@v2
with:
file: ${{ steps.filename.outputs.filename }}