Fixup insta-science-util download --platform
option. (#22)
#11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python Release | |
on: | |
push: | |
tags: | |
- python-v[0-9]+.[0-9]+.[0-9]+ | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: The tag to manually run a deploy for. | |
required: true | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
org-check: | |
name: Check GitHub Organization | |
if: ${{ github.repository_owner == 'a-scie' }} | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Noop | |
run: "true" | |
determine-tag: | |
name: Determine the release tag to operate against. | |
needs: org-check | |
runs-on: ubuntu-24.04 | |
outputs: | |
release-tag: ${{ steps.determine-tag.outputs.release-tag }} | |
release-version: ${{ steps.determine-tag.outputs.release-version }} | |
steps: | |
- name: Determine Tag | |
id: determine-tag | |
run: | | |
if [[ -n "${{ github.event.inputs.tag }}" ]]; then | |
RELEASE_TAG=${{ github.event.inputs.tag }} | |
else | |
RELEASE_TAG=${GITHUB_REF#refs/tags/} | |
fi | |
if [[ "${RELEASE_TAG}" =~ ^python-v[0-9]+.[0-9]+.[0-9]+$ ]]; then | |
echo "release-tag=${RELEASE_TAG}" >> $GITHUB_OUTPUT | |
echo "release-version=${RELEASE_TAG#python-v}" >> $GITHUB_OUTPUT | |
else | |
echo "::error::Release tag '${RELEASE_TAG}' must match 'python-v\d+.\d+.\d+'." | |
exit 1 | |
fi | |
pypi: | |
name: Publish sdist and wheel to PyPI | |
needs: determine-tag | |
runs-on: ubuntu-24.04 | |
environment: Release | |
permissions: | |
id-token: write | |
steps: | |
- name: Checkout science-installers ${{ needs.determine-tag.outputs.release-tag }} | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ needs.determine-tag.outputs.release-tag }} | |
- name: Install the latest version of uv | |
uses: astral-sh/setup-uv@v4 | |
- name: Build sdist and wheel | |
run: uv --directory python build | |
- name: Publish insta-science ${{ needs.determine-tag.outputs.release-version }} | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
packages-dir: python/dist | |
print-hash: true | |
verbose: true |