Skip to content
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
204 changes: 0 additions & 204 deletions .github/workflows/finalize-release.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
name: "Package and Release"
name: "Package"

on:
push:
branches: [release*]
# This workflow will trigger on each push to the `master` branch to create or update a GitHub release, build your app, and upload the artifacts to the release.
workflow_dispatch: # manually triggered
workflow_run:
workflows: ["Release"]
types: [completed]
branches: [master]

jobs:
publish-tauri:
package:
permissions:
contents: write
strategy:
Expand All @@ -13,10 +17,12 @@ jobs:
include:
- platform: "macos-latest" # for Arm based macs (M1 and above).
args: "--target aarch64-apple-darwin"
- platform: "macos-latest" # for Intel based macs.
args: "--target x86_64-apple-darwin"
# - platform: 'ubuntu-22.04' # for Tauri v1 you could replace this with ubuntu-20.04.
# args: ''
- platform: 'macos-latest' # for Intel based macs.
args: '--target x86_64-apple-darwin'
- platform: 'ubuntu-22.04' # for Tauri v1 you could replace this with ubuntu-20.04.
args: ''
# - platform: 'windows-latest'
# args: ''
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -49,11 +55,7 @@ jobs:
- name: Install dependencies and get version
run: |
python -m pip install --upgrade pip
pip install . # Assumes installable via setup.py or pyproject.toml
# Now we can read the version
VERSION=$(python -c "from e3sm_quickview import __version__; print(__version__)")
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Found version: $VERSION"
pip install .[tauri]
shell: bash -l {0}
- name: Package using PyInstaller
run: |
Expand Down Expand Up @@ -82,9 +84,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: v${{ env.VERSION }}
releaseName: "QuickView release v${{ env.VERSION }}"
releaseBody: "See the assets to download this version and install."
releaseDraft: true
tagName: v__VERSION__
releaseDraft: false
prerelease: false
args: ${{ matrix.args }}
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "Release"
on:
workflow_dispatch: # manually triggered

env:
# Many color libraries just need this to be set to any value, but at least
# one distinguishes color depth, where "3" -> "256-bit color".
FORCE_COLOR: 3

jobs:
# https://docs.pypi.org/trusted-publishers/using-a-publisher/
release:
needs: []
name: Distribution build and publish to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write
attestations: write
contents: write
environment:
name: pypi
url: https://pypi.org/p/e3sm-quickview

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Python Semantic Release
id: release
uses: python-semantic-release/python-semantic-release@v10.4.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Generate artifact attestation for sdist and wheel
if: steps.release.outputs.released == 'true'
uses: actions/attest-build-provenance@v2.2.3
with:
subject-path: "dist/*"

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: steps.release.outputs.released == 'true'
23 changes: 23 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,26 @@ quickview = "e3sm_quickview.app2:main"
# Ignore star import issues in ParaView plugins
"e3sm_quickview/plugins/*.py" = ["F403", "F405"]
"e3sm_quickview/pipeline.py" = ["F821"] # Plugin classes loaded dynamically

[tool.semantic_release]
version_toml = [
"pyproject.toml:project.version",
"src-tauri/Cargo.toml:package.version",
]
version_variables = [
"src/e3sm_quickview/__init__.py:__version__",
"src-tauri/tauri.conf.json:version",
]
build_command = """
python -m venv .venv
source .venv/bin/activate
pip install -U pip build
python -m build .
"""

[tool.semantic_release.branches.master]
match = "master"

[tool.semantic_release.publish]
dist_glob_patterns = ["dist/*"]
upload_to_vcs_release = true
Loading
Loading