Skip to content

Commit

Permalink
Add deployment workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
awvwgk committed Nov 6, 2022
1 parent 9238134 commit d5b72de
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 3 deletions.
78 changes: 77 additions & 1 deletion .github/workflows/wheel.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,33 @@
name: wheel

on: [push, workflow_dispatch]
on:
push:
workflow_dispatch:
release:
types: [published]

jobs:
source:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: assets/ci/build-env.yaml
- run: |
meson setup _build
meson dist -C _build --no-tests --include-subprojects
mv _build/meson-dist/*.tar.xz .
- uses: actions/upload-artifact@v3
with:
name: dftd3-source
path: ./*.tar.xz
retention-days: 5

sdist:
runs-on: ubuntu-latest
defaults:
Expand Down Expand Up @@ -86,3 +111,54 @@ jobs:
name: dftd3-python-${{ matrix.python }}
path: ./*.whl
retention-days: 5

release:
needs:
- source
- sdist
- manylinux
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
path: ${{ github.workspace }} # This will download all files

- name: Create SHA256 checksums
run: |
set -ex
for output in dftd3*/*dftd3*; do
pushd $(dirname "$output")
sha256sum $(basename "$output") | tee $(basename "$output").sha256
popd
done
- name: Copy release artifacts
run: |
mkdir dist/
cp -v dftd3*/dftd3*.whl dftd3*/dftd3*.tar.gz dist/
- name: Publish to Test PyPI
if: ${{ github.event_name == 'release' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- name: Upload assets
uses: svenstaro/upload-release-action@v2
if: ${{ github.event_name == 'release' }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dftd3*/*dftd3*
file_glob: true
tag: ${{ github.ref }}
overwrite: true

- name: Publish to PyPI
if: ${{ github.event_name == 'release' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
2 changes: 1 addition & 1 deletion subprojects/mctc-lib.wrap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[wrap-git]
directory = mctc-lib
url = https://github.com/grimme-lab/mctc-lib
revision = v0.3.0
revision = v0.3.1
2 changes: 1 addition & 1 deletion subprojects/toml-f.wrap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[wrap-git]
directory = toml-f
url = https://github.com/toml-f/toml-f
revision = v0.2.2
revision = v0.2.4

0 comments on commit d5b72de

Please sign in to comment.