-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganize release script for two projects (#8)
- Loading branch information
Showing
9 changed files
with
152 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# TODO: This one and sentry_jsonnet are almost the same. | ||
# A reusable flow would help. | ||
name: build sentry_jsonish | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- release-jsonish/** | ||
|
||
jobs: | ||
dist: | ||
name: Create wheel and source distribution for sentry-jsonish | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: "Prepare artifacts" | ||
working-directory: ./sentry_jsonish | ||
run: | | ||
pip install wheel | ||
pip install build | ||
python -m build --wheel | ||
- uses: actions/upload-artifact@v3.1.1 | ||
with: | ||
name: ${{ github.sha }} | ||
path: sentry_jsonish/dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# TODO: This one and sentry_jsonish are almost the same. | ||
# A reusable flow would help. | ||
name: build sentry_jsonnet | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- release-jsonnet/** | ||
|
||
jobs: | ||
dist: | ||
name: Create wheel and source distribution for sentry-jsonnet | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: "Prepare artifacts" | ||
working-directory: ./sentry_jsonnet | ||
run: | | ||
pip install wheel | ||
pip install build | ||
python -m build --wheel | ||
- uses: actions/upload-artifact@v3.1.1 | ||
with: | ||
name: ${{ github.sha }} | ||
path: sentry_jsonnet/dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# TODO: This one and sentry_jsonish are almost the same. | ||
# A reusable flow would help. | ||
name: Release sentry_jsonnet | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: Version to release | ||
required: true | ||
force: | ||
description: Force a release even when there are release-blockers (optional) | ||
required: false | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
name: "Release a new version" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.GH_RELEASE_PAT }} | ||
fetch-depth: 0 | ||
|
||
- name: Prepare release | ||
uses: getsentry/action-prepare-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }} | ||
with: | ||
version: ${{ github.event.inputs.version }} | ||
force: ${{ github.event.inputs.force }} | ||
path: sentry_jsonnet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
set -eux | ||
|
||
OLD_VERSION="${1}" | ||
NEW_VERSION="${2}" | ||
|
||
echo "Current version: $OLD_VERSION" | ||
echo "Bumping version: $NEW_VERSION" | ||
|
||
function replace() { | ||
! grep "$2" $3 | ||
perl -i -pe "s/$1/$2/g" $3 | ||
grep "$2" $3 # verify that replacement was successful | ||
} | ||
|
||
# TODO: The only difference between this and the jsonnet | ||
# version is the path of pyproject. Making that a parameter | ||
# would be trivial but I would have to look into craft details | ||
# to find a way to hardcode a parameter. | ||
replace "version = \"[0-9.]+\"" "version = \"$NEW_VERSION\"" sentry_jsonish/pyproject.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
set -eux | ||
|
||
OLD_VERSION="${1}" | ||
NEW_VERSION="${2}" | ||
|
||
echo "Current version: $OLD_VERSION" | ||
echo "Bumping version: $NEW_VERSION" | ||
|
||
function replace() { | ||
! grep "$2" $3 | ||
perl -i -pe "s/$1/$2/g" $3 | ||
grep "$2" $3 # verify that replacement was successful | ||
} | ||
|
||
# TODO: The only difference between this and the jsonish | ||
# version is the path of pyproject. Making that a parameter | ||
# would be trivial but I would have to look into craft details | ||
# to find a way to hardcode a parameter. | ||
replace "version = \"[0-9.]+\"" "version = \"$NEW_VERSION\"" sentry_jsonnet/pyproject.toml |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
minVersion: 0.34.1 | ||
github: | ||
owner: getsentry | ||
repo: jsonnet-libs | ||
changelogPolicy: auto | ||
preReleaseCommand: bash sbin/bump-version-jsonnet.sh | ||
releaseBranchPrefix: release-sentry-jsonnet | ||
targets: | ||
- name: pypi | ||
- name: sentry-pypi | ||
internalPypiRepo: getsentry/pypi |