Skip to content

Commit

Permalink
Merge branch 'feat/release-github-action' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
brianschubert committed Sep 10, 2023
2 parents de380dc + 68e8422 commit 5166530
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 3 deletions.
86 changes: 86 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Release

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+' # Only run for full release tags

jobs:

download_archives:
uses: ./.github/workflows/web_artifact.yaml
with:
name: 6s-archives
urls: |
[
"https://web.archive.org/web/20220912090811if_/https://rtwilson.com/downloads/6SV-1.1.tar",
"https://web.archive.org/web/20220909154857if_/https://salsa.umd.edu/files/6S/6sV2.1.tar"
]
retention-days: 1

build:
needs: download_archives
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os: [ "windows-latest", "ubuntu-latest", "macos-latest" ]
python-version: [ "3.9", "3.10", "3.11" ]
include:
- os: ubuntu-latest
python-version: '3.11'
sdist: true
steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Set up Fortran
uses: awvwgk/setup-fortran@v1

- name: Install build frontend
run: python -m pip install --upgrade pip build

- name: Retrieve 6S source archives
uses: actions/download-artifact@v3
with:
name: 6s-archives
path: 6s-archives

- name: Build wheel
run: python -I -m build --wheel
env:
SIXS_ARCHIVE_DIR: 6s-archives

- name: Build sdist
if: ${{ matrix.sdist }}
run: python -I -m build --sdist

- uses: actions/upload-artifact@v3
with:
name: dist
path: dist
retention-days: 5
if-no-files-found: error

publish:
needs: build
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Retrieve distributions
uses: actions/download-artifact@v3
with:
name: dist
path: dist

- name: Publish distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# 6S Binary Distribution

[![release workflow](https://github.com/brianschubert/6s-bin/actions/workflows/release.yaml/badge.svg)](https://github.com/brianschubert/6s-bin/actions)
[![tests workflow](https://github.com/brianschubert/6s-bin/actions/workflows/test.yaml/badge.svg)](https://github.com/brianschubert/6s-bin/actions)
[![License](https://img.shields.io/github/license/brianschubert/6s-bin)](./LICENSE)
[![Code style: black](https://img.shields.io/badge/code%20style-black-black.svg)](https://github.com/psf/black)
Expand Down
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "6s-bin"
version = "0.7.0-dev"
version = "0.7.0.dev1"
description = "Convenience distribution for building and installing local 6S executables."
license = "Apache-2.0"
authors = ["Brian Schubert <schubert.b@northeastern.edu>"]
Expand All @@ -17,8 +17,10 @@ packages = [
{ from = "src", include = "sixs_bin" }
]
include = [
"src/sixs_bin/sixsV1.1",
"src/sixs_bin/sixsV2.1",
# Only include compiled 6S binaries in (platform-specific) wheel distributions.
# We don't want them in included in source distributions, since those may be used on different platforms.
{ path = "src/sixs_bin/sixsV1.1", format = "wheel" },
{ path = "src/sixs_bin/sixsV2.1", format = "wheel" },
]

[tool.poetry.build]
Expand Down

0 comments on commit 5166530

Please sign in to comment.