Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #179 from esavary/automated-releases
Browse files Browse the repository at this point in the history
ENH: Automated Package Building and Deployment
  • Loading branch information
effigies authored Apr 26, 2024
2 parents b22efd5 + 129671a commit e707ea3
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/pypi-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
name: Build and upload package

on:
push:
branches: [main]
tags: ["*"]
pull_request:
branches: [ main ]
release:
types:
- published
workflow_dispatch:

permissions:
contents: read
id-token: write

jobs:
build-package:
name: Build & verify package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: hynek/build-and-inspect-python-package@v2

auto-release-test-pypi:
runs-on: ubuntu-latest
needs: [build-package]
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'nipreps/eddymotion' }}

steps:
- name: Download packages built by build-and-inspect-python-package
uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

auto-release-pypi:
runs-on: ubuntu-latest
environment: "Release"
needs: [build-package]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- name: Download packages built by build-and-inspect-python-package
uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit e707ea3

Please sign in to comment.