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

fix: ci release flow #11

Merged
merged 6 commits into from
Dec 18, 2023
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
3 changes: 2 additions & 1 deletion .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.PAT }}
- run: cargo install cargo-edit --version 0.12.2
- name: Install Knope
uses: knope-dev/action@v2.0.0
with:
Expand All @@ -21,5 +22,5 @@ jobs:
git config --global user.name "${{ github.triggering_actor }}"
git config --global user.email "${{ github.triggering_actor}}@users.noreply.github.com"
- name: Prepare Prerelease
run: knope release --prerelease-label=rc
run: knope release --prerelease-label=rc --verbose

3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.PAT }}
- run: cargo install cargo-edit --version 0.12.2
- name: Install Knope
uses: knope-dev/action@v2.0.0
with:
Expand All @@ -22,4 +23,4 @@ jobs:
git config --global user.name "${{ github.triggering_actor }}"
git config --global user.email "${{ github.triggering_actor}}@users.noreply.github.com"
- name: Prepare Release
run: knope release
run: knope release --verbose
12 changes: 12 additions & 0 deletions crates/opentelemetry-macros/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## 0.3.1-rc.1 (2023-12-18)

### Fixes

#### ci release flow

## 0.3.1-rc.0 (2023-12-18)

### Fixes

#### ci release flow

## 0.3.0 (2023-12-16)

### Breaking Changes
Expand Down
2 changes: 1 addition & 1 deletion crates/opentelemetry-macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pyo3-opentelemetry-macros"
version = "0.3.0"
version = "0.3.1-rc.1"
edition = "2021"
categories = ["Python bindings", "OpenTelemetry", "Tracing", "Macros"]
keywords = ["python", "pyo3", "opentelemetry", "tracing"]
Expand Down
18 changes: 18 additions & 0 deletions crates/opentelemetry/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## 0.3.1-rc.1 (2023-12-18)

### Fixes

#### update opentelemetry-macros

#### ci release flow

#### force rc

## 0.3.1-rc.0 (2023-12-18)

### Fixes

#### update opentelemetry-macros

#### ci release flow

## 0.3.0 (2023-12-16)

### Breaking Changes
Expand Down
4 changes: 2 additions & 2 deletions crates/opentelemetry/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pyo3-opentelemetry"
version = "0.3.0"
version = "0.3.1-rc.1"
edition = "2021"
categories = ["Python bindings", "OpenTelemetry", "Tracing", "Macros"]
keywords = ["python", "pyo3", "opentelemetry", "tracing"]
Expand All @@ -20,7 +20,7 @@ opentelemetry = { workspace = true }
opentelemetry_api = { workspace = true }
opentelemetry_sdk = { workspace = true }
pyo3 = { workspace = true }
pyo3-opentelemetry-macros = { path = "../opentelemetry-macros", version = "0.3.0" }
pyo3-opentelemetry-macros = { path = "../opentelemetry-macros", version = "0.3.1-rc.1" }

[dev-dependencies]
futures-util = "0.3.28"
Expand Down
12 changes: 12 additions & 0 deletions crates/tracing-subscriber/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## 0.1.1-rc.1 (2023-12-18)

### Fixes

#### ci release flow

## 0.1.1-rc.0 (2023-12-18)

### Fixes

#### ci release flow

## 0.1.0 (2023-12-16)

### Breaking Changes
Expand Down
2 changes: 1 addition & 1 deletion crates/tracing-subscriber/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pyo3-tracing-subscriber"
version = "0.1.0"
version = "0.1.1-rc.1"
edition = "2021"
categories = ["Python bindings", "OpenTelemetry", "Tracing"]
keywords = ["python", "pyo3", "opentelemetry", "tracing"]
Expand Down
22 changes: 21 additions & 1 deletion knope.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,27 @@ type = "PrepareRelease"

[[workflows.steps]]
type = "Command"
command = "git commit -m \"chore: prepare release\""
command = """
MACROS_VERSION=$(cargo metadata --format-version 1 --no-deps | jq '.packages[] | select(.name=="pyo3-opentelemetry-macros") | .version' -r)
# Specifying the @VERSION here is required for cargo upgrade to ignore the `path` field for the package.
cargo upgrade --package pyo3-opentelemetry-macros@$MACROS_VERSION -i allow --recursive false
git add crates/opentelemetry/Cargo.toml
"""

[[workflows.steps]]
type = "Command"
# Fail the workflow if there are no staged changes added from the previous `cargo upgrade`
command = "! git diff --cached --quiet"

[[workflows.steps]]
type = "Command"
command = "cargo update -w"

[[workflows.steps]]
type = "Command"
# git diff --cached --quiet exits with 0 if there are *no* staged changes.
# So if it exits with any other code, commit the staged changes
command = "(git diff --cached --quiet || git commit -m \"chore: prepare new release(s)\")"

[[workflows.steps]]
type = "Release"
Expand Down
8 changes: 1 addition & 7 deletions scripts/ci/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,5 @@ fi
echo "Running release on branch $GITHUB_REF_NAME (default branch: $DEFAULT_BRANCH)"

git push --tags

if [ -n "$GITHUB_REF_NAME" ]; then
# DEFAULT_BRANCH should be defined in .github/workflows/release.yml
if [ "$GITHUB_REF_NAME" = "$DEFAULT_BRANCH" ]; then
git push -o ci.skip
fi
fi
git push -o ci.skip

Loading