-
Notifications
You must be signed in to change notification settings - Fork 21
75 lines (73 loc) · 1.92 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Release Artifacts
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
build:
name: Build release artifacts
environment: release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: '1.8.3'
- name: Install release dependencies
run: pip install -U typer mistletoe
- name: Build packages
run: |
poetry build
shell: bash
- name: Extract changelog
run: |
python scripts/extract-changelog.py "${TAG_NAME}" | tee RELEASE_CHANGELOG.txt
shell: bash
env:
TAG_NAME: ${{ github.ref_name }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: release_artifacts
path: |
./dist/qiskit*
RELEASE_CHANGELOG.txt
create_release:
name: Create GitHub release
needs: build
environment: release
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Download release artifacts
uses: actions/download-artifact@v4
with:
name: release_artifacts
- name: Create Github release
uses: softprops/action-gh-release@v1
with:
files: ./dist/qiskit*
body_path: "RELEASE_CHANGELOG.txt"
deploy:
name: Deploy to PyPI
needs: build
environment: release
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- name: Download release artifacts
uses: actions/download-artifact@v4
with:
name: release_artifacts
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1