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

ci: create draft release on push tag #61

Merged
merged 2 commits into from
Aug 13, 2024
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
35 changes: 35 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow is used for creating draft release on GitHub. Firstly the
# build workflow (.github/workflows/reusable-build.yaml) is triggered for
# creation wheel and sdist package archives. Then the draft GitHub release is
# created with attached built python package archives.

name: Create release

on:
push:
tags:
- v*

jobs:
build:
uses: qua-platform/quam/.github/workflows/reusable-build.yaml@main
release:
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
pattern: python-package-*
- name: Create release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run:
gh release create ${{ github.ref_name }}
--generate-notes --verify-tag --latest
--draft
"dist/quam-${GITHUB_REF_NAME#v}-py3-none-any.whl"
"dist/quam-${GITHUB_REF_NAME#v}.tar.gz"
43 changes: 43 additions & 0 deletions .github/workflows/reusable-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow is used for building quam python package in dist and wheel
# formats. Built archives is attached to workflow run as artifacts. The
# workflow should only be automatically triggered by other workflows (manual
# build and release).

name: Build python package
on:
workflow_call
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.8"
cache: "pip"


- name: Install python deps
run: python -m pip install -e .[build]

- name: Build python package
run: python -m build

- uses: actions/upload-artifact@v4
id: upload-sdist
name: Upload sdist
with:
name: python-package-sdist
path: dist/quam-*.tar.gz
retention-days: 3
if-no-files-found: error

- uses: actions/upload-artifact@v4
id: upload-wheel
name: Upload wheel
with:
name: python-package-wheel
path: dist/quam-*.whl
retention-days: 3
if-no-files-found: error
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "quam"
version = "0.3.3"
#dynamic = ["version"]
description = "Quantum Abstract Machine (QuAM) facilitates development of abstraction layers in experiments."
authors = [
{ name = "Serwan Asaad", email = "[email protected]" },
Expand Down Expand Up @@ -52,6 +53,7 @@ dev = [
"pytest-mock >= 3.6.1",
]
docs = ["mkdocstrings[python]>=0.18", "mkdocs-gen-files", "mkdocs-jupyter"]
build = ["setuptools >= 71", "setuptools-scm >= 8.1.0", "build >= 1.2.1"]

[tool.black]
target-version = ["py38"]
Expand All @@ -64,6 +66,11 @@ max-line-length = 88
[tool.setuptools]
packages = ["quam"]

# ASK: Verify that we should use scm
[tool.setuptools_scm]
version_scheme = "only-version"
local_scheme = "no-local-version"


# Previous quam settings

Expand Down