-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Implement a prim and proper release workflow
Always build the GH Pages from the default branch to ensure that the documentation is always built with the _latest_ SMV and not e.g. a patch version for an older release line. Move the actual build pipeline into its own reusable workflow in order to allow fine grained builds of the documentation and release artifacts. Add a CI job to create a GH release draft for a new tag which automatically attaches the released build artifacts.
- Loading branch information
1 parent
2766458
commit 6ff97af
Showing
5 changed files
with
123 additions
and
63 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,28 @@ | ||
name: Build branch | ||
|
||
on: | ||
push: | ||
branches: [main, 'release/v*'] | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
python_version: | ||
- '3.8' | ||
- '3.9' | ||
- '3.10' | ||
- '3.11' | ||
- '3.12' | ||
os: [ubuntu-latest, windows-latest] | ||
include: | ||
- python_version: '3.12' | ||
os: ubuntu-latest | ||
upload: true | ||
uses: ./.github/workflows/build.yaml | ||
with: | ||
runs-on: ${{ matrix.os }} | ||
python-version: ${{ matrix.python_version }} | ||
upload-build-artifacts: ${{ matrix.upload == true }} | ||
upload-documentation-artifacts: ${{ matrix.upload == 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
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
This file was deleted.
Oops, something went wrong.
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,61 @@ | ||
name: deploy-pypi | ||
|
||
on: | ||
push: | ||
tags: ['v*'] | ||
|
||
jobs: | ||
build: | ||
name: Build the package | ||
if: github.ref_protected == true | ||
uses: ./.github/workflows/build.yaml | ||
with: | ||
upload-build-artifacts: true | ||
|
||
deploy-pypi: | ||
name: Deploy the package to ${{ matrix.environment }}.org | ||
if: github.ref_protected == true | ||
needs: [build] | ||
strategy: | ||
matrix: | ||
environment: [test.pypi, pypi] | ||
include: | ||
- environment: pypi | ||
repository: https://upload.pypi.org/legacy/ | ||
- environment: test.pypi | ||
repository: https://test.pypi.org/legacy/ | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: ${{ matrix.environment }} | ||
url: https://${{ matrix.environment }}.org/p/sphinx-multiversion | ||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
- name: Download the build artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
- name: Publish Distributions to ${{ matrix.environment }}.org | ||
uses: pypa/gh-action-pypi-publish@fb13cb306901256ace3dab689990e13a5550ffaa | ||
with: | ||
repository-url: ${{ matrix.repository }} | ||
|
||
create-release: | ||
name: Create the GitHub Release | ||
if: github.ref_protected == true | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download the build artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Create the release draft with the build artifacts | ||
uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8 | ||
with: | ||
draft: true | ||
files: dist/* |