Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add release workflow #105

Merged
merged 1 commit into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 1 addition & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
name: build

# Use this workflow to manually trigger a build for testing purposes.
# Download it from artifacts to test installation, or upload directly to PyPI.
on:
workflow_dispatch:
inputs:
release-pypi:
required: true
type: boolean
on: [workflow_dispatch, workflow_call]

jobs:

Expand All @@ -26,20 +19,3 @@ jobs:
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz

release-pypi:
needs: [build_sdist]
runs-on: ubuntu-latest
if: github.event.inputs.release-pypi == 'true'

steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: build-documentation

on: workflow_dispatch
on: [workflow_dispatch, workflow_call]

jobs:
docs:
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release

on:
release:
types: [published]
inputs:
release-pypi:
required: true
type: boolean
default: true
workflow_dispatch:
inputs:
release-pypi:
required: true
type: boolean
description: "if true a release is made on PyPI"

jobs:
test:
uses: sparselm/sparselm/.github/workflows/test.yml@main

build:
needs: test
uses: sparselm/sparselm/.github/workflows/build.yml@main

release-docs:
needs: test
uses: sparselm/sparselm/.github/workflows/docs.yml@main

release-pypi:
needs: [build, docs]
runs-on: ubuntu-latest
if: github.event.inputs.release-pypi == 'true'

steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
branches:
- main

workflow_call:

jobs:
test:
runs-on: ubuntu-20.04
Expand Down