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: adjust the release process to handle publishing ops and ops-scenario #1432

Merged
merged 6 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
61 changes: 0 additions & 61 deletions .github/workflows/build_scenario_wheels.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Publish
on:
release:
types:
- published
push:
tags:
- 'scenario-7.*'

jobs:
framework-tests:
Expand All @@ -12,7 +12,7 @@ jobs:
hello-charm-tests:
uses: ./.github/workflows/hello-charm-tests.yaml
build-n-publish:
name: Build and Publish to PyPI
name: Build and Publish ops-scenario to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write
Expand All @@ -27,9 +27,10 @@ jobs:
run: pip install wheel build
- name: Build
run: python -m build
working-directory: ./testing
- name: Attest build provenance
uses: actions/[email protected]
with:
subject-path: 'dist/*'
subject-path: 'testing/dist/*'
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
39 changes: 39 additions & 0 deletions .github/workflows/publish-ops.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish
on:
push:
tags:
# TODO: When we come to ops v3.x we will need to reconsider what to do
# here (we might want to start prefixing with 'v' for one thing), and we
# will likely be publishing at least three packages: ops, ops-scenario,
# and ops-harness.
- '2.*'

jobs:
framework-tests:
uses: ./.github/workflows/framework-tests.yaml
observability-charm-tests:
uses: ./.github/workflows/observability-charm-tests.yaml
hello-charm-tests:
uses: ./.github/workflows/hello-charm-tests.yaml
build-n-publish:
name: Build and Publish ops to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write
attestations: write
contents: read
needs: [framework-tests, observability-charm-tests, hello-charm-tests]
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
- name: Install build dependencies
run: pip install wheel build
- name: Build
run: python -m build
- name: Attest build provenance
uses: actions/[email protected]
with:
subject-path: 'dist/*'
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
4 changes: 2 additions & 2 deletions .github/workflows/smoke.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: ops Smoke Tests

on:
workflow_dispatch:
schedule:
- cron: '0 7 25 * *'
schedule:
- cron: '0 7 25 * *'

jobs:
test:
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/test-publish-ops-scenario.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test Publish
on: [workflow_dispatch, workflow_call]

jobs:
framework-tests:
uses: ./.github/workflows/framework-tests.yaml
observability-charm-tests:
uses: ./.github/workflows/observability-charm-tests.yaml
hello-charm-tests:
uses: ./.github/workflows/hello-charm-tests.yaml
build-n-publish:
name: Build and Publish ops-scenario to Test PyPI
runs-on: ubuntu-latest
permissions:
id-token: write
attestations: write
contents: read
needs: [framework-tests, observability-charm-tests, hello-charm-tests]
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
- name: Install build dependencies
run: pip install wheel build
- name: Build
run: python -m build
working-directory: ./testing
- name: Attest build provenance
uses: actions/[email protected]
with:
subject-path: 'testing/dist/*'
- name: Publish to test.pypi.org
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
hello-charm-tests:
uses: ./.github/workflows/hello-charm-tests.yaml
build-n-publish:
name: Build and Publish to Test PyPI
name: Build and Publish ops to Test PyPI
runs-on: ubuntu-latest
permissions:
id-token: write
Expand Down
Loading
Loading