Skip to content

Commit

Permalink
Update CI files
Browse files Browse the repository at this point in the history
  • Loading branch information
pulpbot authored and ggainey committed Dec 10, 2024
1 parent fa220d0 commit 1a00169
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/template_gitref
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2021.08.26-406-g5f397e3
2021.08.26-413-g9b1257e
8 changes: 7 additions & 1 deletion .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@
name: "Core PR static checks"
on:
pull_request_target:
types: ["opened", "synchronize", "reopened"]
types:
- "opened"
- "synchronize"
- "reopened"
branches:
- "main"
- "[0-9]+.[0-9]+"

# This workflow runs with elevated permissions.
# Do not even think about running a single bit of code from the PR.
Expand Down
13 changes: 3 additions & 10 deletions .github/workflows/scripts/publish_client_gem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,15 @@ cd "$(dirname "$(realpath -e "$0")")"/../../..

VERSION="$1"

if [[ -z "$VERSION" ]]; then
if [[ -z "${VERSION}" ]]
then
echo "No version specified."
exit 1
fi

RESPONSE="$(curl --write-out '%{http_code}' --silent --output /dev/null "https://rubygems.org/gems/pulpcore_client/versions/$VERSION")"

if [ "$RESPONSE" == "200" ];
then
echo "pulpcore client $VERSION has already been released. Skipping."
exit
fi

mkdir -p ~/.gem
touch ~/.gem/credentials
echo "---
:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials
:rubygems_api_key: ${RUBYGEMS_API_KEY}" > ~/.gem/credentials
sudo chmod 600 ~/.gem/credentials
gem push "pulpcore_client-${VERSION}.gem"
17 changes: 6 additions & 11 deletions .github/workflows/scripts/publish_client_pypi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,13 @@ cd "$(dirname "$(realpath -e "$0")")/../../.."

VERSION="$1"

if [[ -z "$VERSION" ]]; then
if [[ -z "${VERSION}" ]]
then
echo "No version specified."
exit 1
fi

RESPONSE="$(curl --write-out '%{http_code}' --silent --output /dev/null "https://pypi.org/project/pulpcore-client/$VERSION/")"

if [ "$RESPONSE" == "200" ];
then
echo "pulpcore client $VERSION has already been released. Skipping."
else
twine upload -u __token__ -p "$PYPI_API_TOKEN" \
"dist/pulpcore_client-$VERSION-py3-none-any.whl" \
"dist/pulpcore-client-$VERSION.tar.gz"
fi
twine upload -u __token__ -p "${PYPI_API_TOKEN}" \
"dist/pulpcore_client-${VERSION}-py3-none-any.whl" \
"dist/pulpcore-client-${VERSION}.tar.gz" \
;
17 changes: 5 additions & 12 deletions .github/workflows/scripts/publish_plugin_pypi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,13 @@ cd "$(dirname "$(realpath -e "$0")")"/../../..

VERSION="$1"

if [[ -z "$VERSION" ]]; then
if [[ -z "${VERSION}" ]]
then
echo "No version specified."
exit 1
fi

RESPONSE="$(curl --write-out '%{http_code}' --silent --output /dev/null "https://pypi.org/project/pulpcore/$VERSION/")"

if [ "$RESPONSE" == "200" ];
then
echo "pulpcore $VERSION has already been released. Skipping."
exit
fi

twine upload -u __token__ -p "$PYPI_API_TOKEN" \
dist/pulpcore-"$VERSION"-py3-none-any.whl \
dist/pulpcore-"$VERSION".tar.gz \
twine upload -u __token__ -p "${PYPI_API_TOKEN}" \
"dist/pulpcore-${VERSION}-py3-none-any.whl" \
"dist/pulpcore-${VERSION}.tar.gz" \
;
36 changes: 36 additions & 0 deletions .github/workflows/update_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
- name: "Create Pull Request for CI files"
uses: "peter-evans/create-pull-request@v6"
id: "create_pr_main"
with:
token: "${{ secrets.RELEASE_TOKEN }}"
path: "pulpcore"
Expand All @@ -65,6 +66,14 @@ jobs:
branch: "update-ci/main"
base: "main"
delete-branch: true
- name: "Mark PR automerge"
working-directory: "pulpcore"
run: |
gh pr merge --rebase --auto "${{ steps.create_pr_main.outputs.pull-request-number }}"
if: "steps.create_pr_main.outputs.pull-request-number"
env:
GH_TOKEN: "${{ secrets.RELEASE_TOKEN }}"
continue-on-error: true
- uses: "actions/checkout@v4"
with:
fetch-depth: 0
Expand All @@ -78,6 +87,7 @@ jobs:
- name: "Create Pull Request for CI files"
uses: "peter-evans/create-pull-request@v6"
id: "create_pr_3_16"
with:
token: "${{ secrets.RELEASE_TOKEN }}"
path: "pulpcore"
Expand All @@ -87,6 +97,14 @@ jobs:
branch: "update-ci/3.16"
base: "3.16"
delete-branch: true
- name: "Mark PR automerge"
working-directory: "pulpcore"
run: |
gh pr merge --rebase --auto "${{ steps.create_pr_3_16.outputs.pull-request-number }}"
if: "steps.create_pr_3_16.outputs.pull-request-number"
env:
GH_TOKEN: "${{ secrets.RELEASE_TOKEN }}"
continue-on-error: true
- uses: "actions/checkout@v4"
with:
fetch-depth: 0
Expand All @@ -100,6 +118,7 @@ jobs:
- name: "Create Pull Request for CI files"
uses: "peter-evans/create-pull-request@v6"
id: "create_pr_3_18"
with:
token: "${{ secrets.RELEASE_TOKEN }}"
path: "pulpcore"
Expand All @@ -109,6 +128,14 @@ jobs:
branch: "update-ci/3.18"
base: "3.18"
delete-branch: true
- name: "Mark PR automerge"
working-directory: "pulpcore"
run: |
gh pr merge --rebase --auto "${{ steps.create_pr_3_18.outputs.pull-request-number }}"
if: "steps.create_pr_3_18.outputs.pull-request-number"
env:
GH_TOKEN: "${{ secrets.RELEASE_TOKEN }}"
continue-on-error: true
- uses: "actions/checkout@v4"
with:
fetch-depth: 0
Expand All @@ -122,6 +149,7 @@ jobs:
- name: "Create Pull Request for CI files"
uses: "peter-evans/create-pull-request@v6"
id: "create_pr_3_21"
with:
token: "${{ secrets.RELEASE_TOKEN }}"
path: "pulpcore"
Expand All @@ -131,4 +159,12 @@ jobs:
branch: "update-ci/3.21"
base: "3.21"
delete-branch: true
- name: "Mark PR automerge"
working-directory: "pulpcore"
run: |
gh pr merge --rebase --auto "${{ steps.create_pr_3_21.outputs.pull-request-number }}"
if: "steps.create_pr_3_21.outputs.pull-request-number"
env:
GH_TOKEN: "${{ secrets.RELEASE_TOKEN }}"
continue-on-error: true
...

0 comments on commit 1a00169

Please sign in to comment.