Skip to content

Commit

Permalink
fix: Minor fix release (#50)
Browse files Browse the repository at this point in the history
* fix: Publish Release notes
  • Loading branch information
Ryan Faircloth authored Feb 13, 2021
1 parent 1c3a131 commit 5ea99b4
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 29 deletions.
20 changes: 1 addition & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
pip install pip --upgrade
pip install -r requirements_dev.txt --use-deprecated=legacy-resolver || true
pip install semantic_version==2.6.0
pip install git+https://github.com/pixelb/crudini
sudo apt install npm
- run:
Expand Down Expand Up @@ -473,25 +474,6 @@ jobs:
command: |
npx semantic-release
publish-gh:
docker:
- image: circleci/python:3.7
steps:
- setup_remote_docker:
docker_layer_caching: true
- attach_workspace:
at: /tmp/workspace
- checkout
- go/install
- run:
name: "Publish on GitHub"
command: |
PATH=$PATH:/usr/local/go/bin
go get -v -u github.com/tcnksm/ghr
[[ << pipeline.git.tag >> =~ ^v[0-9]*.[0-9]*.[0-9]*$ ]] || export ISPRE=-prerelease
$HOME/go/bin/ghr -t ${GH_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${ISPRE} -delete "<< pipeline.git.tag >>" /tmp/workspace/build/package/splunkbase
$HOME/go/bin/ghr -t ${GH_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${ISPRE} "<< pipeline.git.tag >>" /tmp/workspace/build/package/deployment
publish-sbase:
docker:
- image: circleci/python:3.7
Expand Down
36 changes: 36 additions & 0 deletions .circleci/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
source .splunkbase
source ~/.venv/bin/activate
PACKAGE=$(ls build/package/splunkbase/*)
PACKAGE_ID=$(crudini --get package/default/app.conf id name)
[[ $1 =~ ^v[0-9]*.[0-9]*.[0-9]*$ ]] || export ISPRE=-prerelease
SPLUNKBASE_VERSION=$(echo $1 | sed 's/^v//' | sed 's/-develop./develop/g')
echo publish $SPLUNKBASE_VERSION
[ "${ISPRE}" == "-prerelease" ] && SPLUNKBASE_VIS="false" || SPLUNKBASE_VIS="true"
echo uploading package
BASE=https://splunkbase.splunk.com/api/v0.1/app/${SPLUNKBASE_ID}/release/
echo $BASE

curl -u ${SPLUNKBASE_USERNAME}:${SPLUNKBASE_PASSWORD} \
--request POST https://splunkbase.splunk.com/api/v1/app/${SPLUNKBASE_ID}/new_release/ \
-F "files[]=@${PACKAGE}" -F "filename=${PACKAGE_ID}.spl" \
-F "splunk_versions=${SPLUNKBASE_SPLUNK_VERSION}" \
-F "visibility=${SPLUNKBASE_VIS}"
sleep 30
ITEM=$(curl -u ${SPLUNKBASE_USERNAME}:${SPLUNKBASE_PASSWORD} \
--request GET $BASE \
| jq ".[] | select(.name==\"$SPLUNKBASE_VERSION\") | .id")

echo get $ITEM
CURRENT=$(curl -u ${SPLUNKBASE_USERNAME}:${SPLUNKBASE_PASSWORD} \
--request GET $BASE${ITEM}/ \
| jq )

NOTES=$(cat CHANGELOG.md | jq -sR)
NEW=$(echo $CURRENT | jq ".release_notes = $NOTES" | jq -c)
curl -u ${SPLUNKBASE_USERNAME}:${SPLUNKBASE_PASSWORD} \
--location \
--request PUT $BASE${ITEM}/ \
--header 'Content-Type: application/json' \
--data-raw "$NEW" | jq

12 changes: 2 additions & 10 deletions .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,11 @@
"addReleases": "top"
}
],
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
[
"@semantic-release/exec",
{
"prepareCmd": ".circleci/package_release.sh ${nextRelease.version}"
"prepareCmd": ".circleci/package_release.sh ${nextRelease.version}",
"publishCmd": ".circleci/publish.sh ${nextRelease.version}"
}
]
]
Expand Down
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
## [6.0.9-develop.5](https://github.com/splunk/seckit_sa_geolocation/compare/v6.0.9-develop.4...v6.0.9-develop.5) (2021-02-12)


### Bug Fixes

* timeout ([e42986a](https://github.com/splunk/seckit_sa_geolocation/commit/e42986acb15a4318fe42728434ac7a6dbc34b918))

## [6.0.9-develop.4](https://github.com/splunk/seckit_sa_geolocation/compare/v6.0.9-develop.3...v6.0.9-develop.4) (2021-02-12)


### Bug Fixes

* venv ([bf30852](https://github.com/splunk/seckit_sa_geolocation/commit/bf30852eecbceabc50c14b11639008f421fcf3e6))

## [6.0.9-develop.3](https://github.com/splunk/seckit_sa_geolocation/compare/v6.0.9-develop.2...v6.0.9-develop.3) (2021-02-12)


### Bug Fixes

* shebang ([61b73c5](https://github.com/splunk/seckit_sa_geolocation/commit/61b73c53c3f1012ad1cf3f642977cf54304c6d37))

## [6.0.9-develop.2](https://github.com/splunk/seckit_sa_geolocation/compare/v6.0.9-develop.1...v6.0.9-develop.2) (2021-02-12)


### Bug Fixes

* missing crud ini ([393e5bc](https://github.com/splunk/seckit_sa_geolocation/commit/393e5bcda04e94523ff6e8b06d59a799950db628))

## [6.0.9-develop.1](https://github.com/splunk/seckit_sa_geolocation/compare/v6.0.8...v6.0.9-develop.1) (2021-02-12)


### Bug Fixes

* Publish Release notes ([fafe1bf](https://github.com/splunk/seckit_sa_geolocation/commit/fafe1bf29893ac9542f0016220fe39fb0e40e902))

## [6.0.8](https://github.com/splunk/seckit_sa_geolocation/compare/v6.0.7...v6.0.8) (2021-02-12)


Expand Down

0 comments on commit 5ea99b4

Please # to comment.