Skip to content

Commit

Permalink
Merge pull request #545 from nansencenter/hotfix_release_metadata
Browse files Browse the repository at this point in the history
Hotfix: release metadata
  • Loading branch information
aperrin66 authored May 21, 2024
2 parents 45bcb77 + 75ccf3d commit fd06666
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/tests_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: ['**']
release:
types: [released]
types: [prereleased, released]
env:
IMAGE_NAME: "${{ vars.DOCKER_ORG }}/nansat"
BASE_IMAGE_NAME: "${{ vars.DOCKER_ORG }}/nansat_base"
Expand All @@ -26,6 +26,8 @@ jobs:
steps:
- name: 'Checkout repository'
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down Expand Up @@ -80,7 +82,6 @@ jobs:
context: .
build-args: |
BASE_IMAGE=${{ env.BASE_IMAGE_NAME }}:${{ env.BASE_IMAGE_TAG }}-python${{ matrix.python_version }}
NANSAT_RELEASE=${{ github.ref_type == 'tag' && github.ref_name || '0.0.0' }}
push: ${{ github.ref_type == 'tag' }}
tags: |
${{ env.IMAGE_NAME }}:${{ github.ref_name }}-python${{ matrix.python_version }}
Expand All @@ -106,14 +107,11 @@ jobs:
steps:
- name: 'Checkout repository'
uses: actions/checkout@v4

- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
fetch-depth: 0

- name: Build package
run: NANSAT_RELEASE="${{ github.ref_type == 'tag' && github.ref_name || '0.0.0' }}" python setup.py sdist
run: docker run --rm -v "$(pwd):/src" "$BASE_IMAGE_NAME" python setup.py sdist
shell: bash

- name: Publish
Expand Down
8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ ARG BASE_IMAGE

ARG NANSAT_RELEASE

COPY utilities /tmp/utilities
COPY nansat /tmp/nansat
COPY setup.py /tmp/
WORKDIR /tmp
COPY . /tmp/nansat/
WORKDIR /tmp/nansat
RUN apt update \
&& apt install -y --no-install-recommends g++ \
&& pip install . \
&& rm -rf /tmp/{utilities,nansat,setup.py} \
&& rm -rf /tmp/nansat \
&& apt autoremove -y \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ def run_setup(skip_compile):

setup(
name=NAME,
version=VERSION,
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
description=DESCRIPTION,
Expand All @@ -237,6 +236,8 @@ def run_setup(skip_compile):
cmdclass = {'install_scripts': my_install_scripts},
install_requires=REQS,
test_suite="nansat.tests",
use_scm_version=True,
setup_requires=['setuptools_scm'],
**kw
)

Expand Down

0 comments on commit fd06666

Please sign in to comment.