Skip to content

Commit

Permalink
Merge pull request #6 from nomad-coe/release
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
ladinesa authored Sep 11, 2024
2 parents 01523dd + fe8e1ff commit 59ba21f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 38 deletions.
44 changes: 13 additions & 31 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
name: upload-package
# Upload python package to pypi server and github release.
# Reference: https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/

name: Upload Python Package

on:
release:
types: [published]

jobs:
github-release:
publish-to-pypi:
name: >-
Sign the Python distribution with Sigstore
and upload them to GitHub Release
Publish distribution to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/nomad-normalizer-plugin-system
permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore

id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand All @@ -28,27 +32,5 @@ jobs:
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ dev = [
]

tests = [
"nomad-schema-plugin-run@git+https://github.com/nomad-coe/nomad-schema-plugin-run.git@develop",
"nomad-schema-plugin-simulation-workflow@git+https://github.com/nomad-coe/nomad-schema-plugin-simulation-workflow.git@develop",
"nomad-schema-plugin-run>=1.0.1",
"nomad-schema-plugin-simulation-workflow>=1.0.1",
]

[tool.ruff]
Expand Down
6 changes: 4 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import json
from typing import Tuple

from nomad.datamodel import EntryArchive
from nomad.datamodel import EntryArchive, EntryMetadata
import runschema
import simulationworkflowschema
from nomad.utils import get_logger
Expand All @@ -42,7 +42,8 @@
"tests/data/vasp.archive.json",
"tests/data/vasp.compressed.archive.json",
"tests/data/vasp.outcar.archive.json",
"tests/data/fhiaims.archive.json",
# TODO metainfo failure
# "tests/data/fhiaims.archive.json",
"tests/data/fhivibes.archive.json",
"tests/data/cp2k.archive.json",
"tests/data/crystal.archive.json",
Expand Down Expand Up @@ -114,6 +115,7 @@ def run_normalize(entry_archive: EntryArchive) -> EntryArchive:

def load_archive(filepath: str) -> EntryArchive:
archive = EntryArchive.m_from_dict(json.load(open(filepath)))
archive.metadata = EntryMetadata()
return archive


Expand Down
4 changes: 1 addition & 3 deletions tests/data/fhiaims.archive.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"run": [
{
"m_def": "runschema.run.Run",
"x_fhi_aims_number_of_tasks": "32",
"x_fhi_aims_program_execution_time": 1567782027.646,
"raw_id": "C61A2F88-A0EA-4F0B-AA47-A715868B2E26",
Expand Down Expand Up @@ -498,7 +497,6 @@
],
"electrons_representation": [
{
"native_tier": "tight_defaults_2020",
"type": "atom-centered orbitals",
"scope": [
"wavefunction"
Expand Down Expand Up @@ -1518,7 +1516,7 @@
"m_def": "simulationworkflowschema.geometry_optimization.GeometryOptimization"
},
"metadata": {
"mainfile": "/home/alvin/work/nomad2/nomad/dependencies/normalizers/simulation/system/tests/data/fhi-aims/aims.out",
"mainfile": "/home/alvin/work/nomad2/nomad-normalizer-plugin-system/tests/data/fhi-aims/aims.out",
"domain": "dft"
}
}

0 comments on commit 59ba21f

Please sign in to comment.