-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
198 additions
and
8 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
github: jsirois | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'python/**' | ||
- '!python/**.md' | ||
pull_request: | ||
paths: | ||
- 'python/**' | ||
- '!python/**.md' | ||
defaults: | ||
run: | ||
shell: bash | ||
concurrency: | ||
group: CI-${{ github.ref }} | ||
# Queue on all branches and tags, but only cancel overlapping PR burns. | ||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/') }} | ||
jobs: | ||
org-check: | ||
name: Check GitHub Organization | ||
if: github.repository_owner == 'a-scie' | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Noop | ||
run: "true" | ||
checks: | ||
name: ${{ matrix.name }} | ||
needs: org-check | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
- name: "Linux Python 3.9" | ||
os: "ubuntu-24.04" | ||
python-version: "3.9" | ||
- name: "Linux Python 3.13" | ||
os: "ubuntu-24.04" | ||
python-version: "3.13" | ||
- name: "Mac Python 3.13" | ||
os: "macos-14" | ||
python-version: "3.13" | ||
- name: "Windows Python 3.13" | ||
os: "windows-2022" | ||
python-version: "3.13" | ||
steps: | ||
- name: Checkout science-installers | ||
uses: actions/checkout@v4 | ||
- name: Install the latest version of uv | ||
uses: astral-sh/setup-uv@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Run CI checks | ||
run: uv --directory python run dev-cmd ci -- -vvs | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: 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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Build artifacts dirs. | ||
/*.egg-info/ | ||
/build/ | ||
|
||
# Python bytecode. | ||
__pycache__/ | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# insta-science | ||
|
||
## 0.1.0.dev0 | ||
|
||
Prime release channel (will be deleted). | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Release Process | ||
|
||
## Preparation | ||
|
||
### Version Bump and Changelog | ||
|
||
1. Bump the version in [`insta_science/__init__.py`](insta_science/__init__.py). | ||
2. Run `uv run dev-cmd` as a sanity check on the state of the project. | ||
3. Update [`CHANGES.md`](CHANGES.md) with any changes that are likely to be useful to consumers. | ||
4. Open a PR with these changes and land it on https://github.com/a-scie/science-installers main. | ||
|
||
## Release | ||
|
||
### Push Release Tag | ||
|
||
Sync a local branch with https://github.com/a-scie/science-installers main and confirm it has the | ||
version bump and changelog update as the tip commit: | ||
``` | ||
$ git log --stat -1 HEAD | grep -E "CHANGES|__init__" | ||
python/CHANGES.md | 5 + | ||
python/insta_science/__init__.py | 4 +``` | ||
``` | ||
|
||
Tag the release as `python-v<version>` and push the tag to | ||
https://github.com/a-scie/science-installers main: | ||
``` | ||
$ git tag --sign -am 'Release 0.1.0' python-v0.1.0 | ||
$ git push --tags https://github.com/a-scie/science-installers HEAD:main | ||
``` | ||
|
||
The release is automated and will create a PyPI release at | ||
[https://pypi.org/project/insta-science/<version>/]( | ||
https://pypi.org/project/insta-science/#history). |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Copyright 2024 Science project contributors. | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
__version__ = "0.1.0" | ||
__version__ = "0.1.0.dev0" |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.