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

Component release/openai try 5 #2872

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
fc1f599
up
lmolkova Sep 13, 2024
ec7bedc
up
lmolkova Sep 13, 2024
abea0ad
up
lmolkova Sep 13, 2024
4dcd3c7
up
lmolkova Sep 13, 2024
5ecdd20
up
lmolkova Sep 13, 2024
893dfa6
up
lmolkova Sep 13, 2024
c181d34
up
lmolkova Sep 13, 2024
7482f15
up
lmolkova Sep 13, 2024
aac6598
up
lmolkova Sep 13, 2024
a376e2f
up
lmolkova Sep 13, 2024
796b394
up
lmolkova Sep 13, 2024
0961202
up
lmolkova Sep 13, 2024
fcd27e4
component release
lmolkova Sep 14, 2024
9842077
Copy change log updates from component-release/openai-try
opentelemetrybot Sep 14, 2024
5b09598
Merge pull request #6 from lmolkova/opentelemetrybot/copy-change-log-…
lmolkova Sep 14, 2024
0b1de18
Copy change log updates from component-release/openai-try-2
opentelemetrybot Sep 14, 2024
d1347ee
Merge pull request #8 from lmolkova/opentelemetrybot/copy-change-log-…
lmolkova Sep 14, 2024
8ffce35
Update CHANGELOG.md
lmolkova Sep 14, 2024
881a22f
Copy change log updates from component-release/openai-try-3
opentelemetrybot Sep 14, 2024
40f42f9
Merge pull request #10 from lmolkova/opentelemetrybot/copy-change-log…
lmolkova Sep 14, 2024
1e97ce2
Update CHANGELOG.md
lmolkova Sep 14, 2024
13a47bb
Copy change log updates from component-release/openai-try-4
opentelemetrybot Sep 14, 2024
be60fc3
Merge pull request #12 from lmolkova/opentelemetrybot/copy-change-log…
lmolkova Sep 14, 2024
c43972a
Add consistent import statement for URLLibInstrumentor (#2868)
BryanFauble Sep 13, 2024
7c26101
component release
lmolkova Sep 14, 2024
e03ade2
fix
lmolkova Sep 14, 2024
f3ebe6c
fix
lmolkova Sep 14, 2024
b13044a
prepare package release
lmolkova Sep 14, 2024
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
1,061 changes: 0 additions & 1,061 deletions .github/workflows/lint_0.yml

This file was deleted.

129 changes: 0 additions & 129 deletions .github/workflows/misc_0.yml

This file was deleted.

155 changes: 155 additions & 0 deletions .github/workflows/package-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
name: Release individual package
on:
workflow_dispatch:
inputs:
package:
type: choice
options:
- opentelemetry-instrumentation-openai
description: 'Package to be released'
required: true
jobs:
release:
runs-on: ubuntu-latest
steps:
- run: |
if [[ $GITHUB_REF_NAME != package-release/* ]]; then
echo this workflow should only be run against package-release branches
exit 1
fi

- uses: actions/checkout@v4

- name: Set environment variables
run: |
version=$(./scripts/eachdist.py version --package ${{ inputs.package }})
if [[ $version =~ ^([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
major="${BASH_REMATCH[1]}"
minor="${BASH_REMATCH[2]}"
patch="${BASH_REMATCH[3]}"
if [[ $patch != 0 ]]; then
prior_version_when_patch="${major}.${minor}.$((patch - 1))"
fi
elif [[ $version =~ ^([0-9]+)\.([0-9]+)b([0-9]+)$ ]]; then
major="${BASH_REMATCH[1]}"
minor="${BASH_REMATCH[2]}"
patch="${BASH_REMATCH[3]}"

if [[ $patch != 0 ]]; then
prior_version_when_patch="${major}.${minor}b$((patch - 1))"
fi
else
echo "unexpected version: $version"
exit 1
fi

path=$(./scripts/eachdist.py find-package --package ${{ inputs.package }})
echo "CHANGELOG=./$path/CHANGELOG.md" >> $GITHUB_ENV
echo "PACKAGE_NAME=${{ inputs.package }}" >> $GITHUB_ENV
echo "VERSION=$version" >> $GITHUB_ENV
echo "RELEASE_TAG=${{ inputs.package }}==$version" >> $GITHUB_ENV
echo "PRIOR_VERSION_WHEN_PATCH=$prior_version_when_patch" >> $GITHUB_ENV

# check out main branch to verify there won't be problems with merging the change log
# at the end of this workflow
- uses: actions/checkout@v4
with:
ref: main

- name: Check that change log update was merged to main
run: |
if [[ -z $PRIOR_VERSION_WHEN_PATCH ]]; then
# not making a patch release
if ! grep --quiet "^## Version ${VERSION}" ${CHANGELOG}; then
echo the pull request generated by prepare-release-branch.yml needs to be merged first
exit 1
fi
fi

# back to the release branch
- uses: actions/checkout@v4

# next few steps publish to pypi
- uses: actions/setup-python@v5
with:
python-version: '3.8'

- name: Build wheels
run: ./scripts/build_a_package.sh

- name: Install twine
run: |
pip install twine

# The step below publishes to testpypi in order to catch any issues
# with the package configuration that would cause a failure to upload
# to pypi. One example of such a failure is if a classifier is
# rejected by pypi (e.g "3 - Beta"). This would cause a failure during the
# middle of the package upload causing the action to fail, and certain packages
# might have already been updated, this would be bad.
# EDIT: 5/31/2024 - TestPypi now requires a verified email. Commenting out as a temporary measure
# until we found TestPypi credentials.
# - name: Publish to TestPyPI
# env:
# TWINE_USERNAME: '__token__'
# TWINE_PASSWORD: ${{ secrets.test_pypi_token }}
# run: |
# twine upload --repository testpypi --skip-existing --verbose dist/*

- name: Publish to PyPI
env:
TWINE_USERNAME: '__token__'
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: |
twine upload --skip-existing --verbose dist/*
continue-on-error: true

- name: Generate release notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./scripts/generate_release_notes.sh

- name: Create GitHub release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create --target $GITHUB_REF_NAME \
--title "${PACKAGE_NAME} ${VERSION}" \
--notes-file /tmp/release-notes.txt \
--discussion-category announcements \
$RELEASE_TAG

- uses: actions/checkout@v4
with:
ref: main

- name: Copy change log updates to main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./scripts/merge_changelog_to_main.sh

- name: Use CLA approved github bot
run: .github/scripts/use-cla-approved-github-bot.sh

- name: Create pull request against main
env:
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
run: |
message="Copy change log updates from $GITHUB_REF_NAME"
body="Copy log updates from \`$GITHUB_REF_NAME\`."
branch="opentelemetrybot/copy-change-log-updates-from-${GITHUB_REF_NAME//\//-}"

if [[ -z $PRIOR_VERSION_WHEN_PATCH ]]; then
if git diff --quiet; then
echo there are no updates needed to the change log on main, not creating pull request
exit 0 # success
fi
fi

git commit -a -m "$message"
git push origin HEAD:$branch
gh pr create --title "$message" \
--body "$body" \
--head $branch \
--base main
Loading