forked from canonical/operator
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (49 loc) · 1.77 KB
/
build_scenario_wheels.yaml
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
name: Build ops-scenario wheels
# TODO: adjust this workflow to properly build ops-scenario from the operator repo
# and then this should be adjusted to run when appropriate (not on push to main
# any more, but as part of the releasing workflow we agree on).
on:
workflow_dispatch
# push:
# branches:
# - main
jobs:
build_wheel:
name: Build wheel on ubuntu (where else???)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install build
run: pip install build
- name: Build wheel
run: python -m build
- uses: actions/upload-artifact@v3
with:
path: ./dist/*.whl
- name: Get the version
id: get_version
run: echo "VERSION=$(sed -n 's/^ *version.*=.*"\([^"]*\)".*/\1/p' pyproject.toml)" >> $GITHUB_OUTPUT
- name: release
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: false
tag_name: ${{ steps.get_version.outputs.VERSION }}
release_name: ${{ steps.get_version.outputs.VERSION }}
env:
GITHUB_TOKEN: ${{ github.token }}
- name: upload wheel
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/ops_scenario-${{ steps.get_version.outputs.VERSION }}-py3-none-any.whl
asset_name: ops_scenario-${{ steps.get_version.outputs.VERSION }}-py3-none-any.whl
asset_content_type: application/wheel
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}