Skip to content

Bump version to 0.5.3 #207

Bump version to 0.5.3

Bump version to 0.5.3 #207

Workflow file for this run

# This file is part of tad-dftd4.
#
# SPDX-Identifier: Apache-2.0
# Copyright (C) 2024 Grimme Group
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Build
on:
push:
branches:
- main
- master
tags:
- "v*"
paths-ignore:
- "doc*/**"
- "./*.ya?ml"
- "**/*.md"
- "**/*.rst"
pull_request:
paths-ignore:
- "doc*/**"
- "./*.ya?ml"
- "**/*.md"
- "**/*.rst"
workflow_dispatch:
jobs:
sdist:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Build source distribution (sdist)
run: pipx run build --sdist
- name: Upload source distribution as artifact
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-sdist
path: dist
wheel:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Build wheel (bdist)
run: pipx run build --wheel
- name: Upload wheel as artifact
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-wheel
path: dist
install_wheel:
needs: [wheel]
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Show downloaded artifacts
run: ls -lcahFR --color=auto dist
- name: Install wheel
run: |
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install dist/*.whl
- name: Determine package name
run: |
name=$(echo "${REPO_NAME}" | tr '-' '_')
echo "PKG_NAME=$name" >> "$GITHUB_ENV"
echo "PKG_NAME is set to '${name}'."
env:
REPO_NAME: ${{ github.event.repository.name }}
- name: Test import
run: python -c "import ${PKG_NAME}; print(${PKG_NAME}.__version__)"
env:
PKG_NAME: ${{ env.PKG_NAME }}
upload_test_pypi:
needs: [sdist, wheel]
runs-on: ubuntu-latest
environment: release
permissions:
contents: read
id-token: write
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
upload_pypi:
needs: [sdist, wheel, upload_test_pypi]
runs-on: ubuntu-latest
environment: release
permissions:
contents: read
id-token: write
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1