Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Commit 5a6a068

Browse files
test: Added circle_tag param for publishing
1 parent ebc2f1e commit 5a6a068

File tree

2 files changed

+49
-10
lines changed

2 files changed

+49
-10
lines changed

.circleci/config.yml

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,16 @@ orbs:
3333
npx -p @semantic-release/exec -p semantic-release semantic-release --dry-run --plugins "@semantic-release/commit-analyzer,@semantic-release/exec" --analyzeCommits @semantic-release/commit-analyzer --verifyRelease @semantic-release/exec --verifyReleaseCmd 'echo ${nextRelease.version} > nextRelease.txt'
3434
sed -i "s/-develop./develop/g" nextRelease.txt
3535
VERSION=$(cat nextRelease.txt)
36-
echo "$VERSION"
36+
echo VERSION="$VERSION"
3737
source ~/.venv/bin/activate
38-
ucc-gen --ta-version="$VERSION"
38+
if [ -z "$CIRCLE_TAG" ]
39+
then
40+
ucc-gen --ta-version="$VERSION"
41+
else
42+
CIRCLE_TAG=${CIRCLE_TAG:1}
43+
echo CIRCLE_TAG=$CIRCLE_TAG
44+
ucc-gen --ta-version="$CIRCLE_TAG"
45+
fi
3946
- run:
4047
name: Generating package
4148
command: |
@@ -495,6 +502,26 @@ jobs:
495502
name: "Publish on GitHub"
496503
command: |
497504
npx semantic-release
505+
506+
publish-gh:
507+
docker:
508+
- image: circleci/python:3.7
509+
steps:
510+
- setup_remote_docker:
511+
docker_layer_caching: true
512+
- attach_workspace:
513+
at: /tmp/workspace
514+
- checkout
515+
- go/install
516+
- run:
517+
name: "Publish on GitHub"
518+
command: |
519+
PATH=$PATH:/usr/local/go/bin
520+
go get -v -u github.com/tcnksm/ghr
521+
[[ << pipeline.git.tag >> =~ ^v[0-9]*.[0-9]*.[0-9]*$ ]] || export ISPRE=-prerelease
522+
$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
523+
$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
524+
498525
publish-sbase:
499526
docker:
500527
- image: circleci/python:3.7
@@ -568,6 +595,7 @@ workflows:
568595
requires:
569596
- package
570597
matrix:
598+
alias: splunk-app-test-knowledge
571599
parameters:
572600
splunk_version: ["7.2","7.3","8.0","8.1"]
573601
sc4s_version: ["1"]
@@ -582,6 +610,7 @@ workflows:
582610
requires:
583611
- package
584612
matrix:
613+
alias: splunk-app-test-ui
585614
parameters:
586615
splunk_version: ["7.3","8.0","8.1"]
587616
sc4s_version: ["1"]
@@ -595,6 +624,7 @@ workflows:
595624
requires:
596625
- package
597626
matrix:
627+
alias: splunk-app-test-modinput
598628
parameters:
599629
splunk_version: ["7.3","8.0","8.1"]
600630
sc4s_version: ["1"]
@@ -629,6 +659,12 @@ workflows:
629659
- approval-release:
630660
requires:
631661
- package
662+
# - splunk-app-inspect
663+
# - splunk-app-test-knowledge
664+
# - splunk-app-test-ui
665+
# - splunk-app-test-modinput
666+
# - splunk-app-unit-test
667+
# - splunk-app-backend-test
632668
context:
633669
- gdi-github
634670
type: approval
@@ -640,9 +676,6 @@ workflows:
640676
- release:
641677
requires:
642678
- approval-release
643-
## - splunk-app-inspect
644-
## - splunk-app-unit-test
645-
## - splunk-app-backend-test
646679
context:
647680
- gdi-github
648681
publish:
@@ -654,6 +687,16 @@ workflows:
654687
ignore: /.*/
655688
tags:
656689
only: /^v\d*\.\d*\.\d*.*$/
690+
- publish-gh:
691+
context:
692+
- gdi-github
693+
requires:
694+
- package
695+
filters:
696+
branches:
697+
ignore: /.*/
698+
tags:
699+
only: /^v\d*\.\d*\.\d*.*$/
657700
- publish-sbase:
658701
context:
659702
- gdi-splunkbase

.releaserc.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,4 @@ branches:
77
prerelease: true
88
plugins:
99
- "@semantic-release/commit-analyzer"
10-
- "@semantic-release/release-notes-generator"
11-
- - "@semantic-release/github"
12-
- assets:
13-
- /tmp/workspace/build/package/splunkbase/*
14-
- /tmp/workspace/build/package/deployment/*
10+
- "@semantic-release/release-notes-generator"

0 commit comments

Comments
 (0)