Skip to content

Commit 50fd907

Browse files
feat(release): addonfactory packaging toolkit action removal (#230)
This PR removes addonfactory-packaging-toolkit-action from the workflow and replaces it with direct logic. It also skips the step of partitioning so release on GitHub only contains files that are used by the developers. https://splunk.atlassian.net/browse/ADDON-68239 Tested here: https://github.com/splunk/test-addonfactory-repo/actions/runs/7902209078 Example release : https://github.com/splunk/test-addonfactory-repo/releases/tag/v0.7.2
1 parent 7c558f6 commit 50fd907

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

.github/workflows/reusable-build-test-release.yml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -638,9 +638,24 @@ jobs:
638638
version: ${{ steps.BuildVersion.outputs.VERSION }}
639639
- name: Slim Package
640640
id: slim
641-
uses: splunk/addonfactory-packaging-toolkit-action@v1
642-
with:
643-
source: ${{ steps.uccgen.outputs.OUTPUT }}
641+
run: |
642+
pip install splunk-packaging-toolkit
643+
INPUT_SOURCE=${{ steps.uccgen.outputs.OUTPUT }}
644+
SOURCE_REGEX='^.*/$'
645+
if [[ $INPUT_SOURCE =~ $SOURCE_REGEX ]];then
646+
echo Removing trailing / from INPUT_SOURCE slim is picky
647+
INPUT_SOURCE=$(echo $INPUT_SOURCE | sed 's/\(.*\)\//\1/')
648+
fi
649+
mkdir -p build/package/splunkbase
650+
slim package -o build/package/splunkbase "${INPUT_SOURCE}"
651+
for f in build/package/splunkbase/*.tar.gz; do
652+
n=$(echo "${f}" | awk '{gsub("-[0-9]+.[0-9]+.[0-9]+-[a-f0-9]+-?", "");print}' | sed 's/.tar.gz/.spl/')
653+
mv "${f}" "${n}"
654+
done
655+
PACKAGE=$(ls build/package/splunkbase/*)
656+
slim validate "${PACKAGE}"
657+
chmod -R +r build
658+
echo "OUTPUT=$PACKAGE" >> "$GITHUB_OUTPUT"
644659
if: always()
645660
- name: artifact-openapi
646661
uses: actions/upload-artifact@v3
@@ -664,12 +679,6 @@ jobs:
664679
echo "name=$(basename "${{ steps.slim.outputs.OUTPUT }}")" >> "$GITHUB_OUTPUT"
665680
basename "${{ steps.slim.outputs.OUTPUT }}"
666681
aws s3 cp "${{ steps.slim.outputs.OUTPUT }}" s3://ta-production-artifacts/ta-apps/
667-
- name: artifact-splunk-parts
668-
uses: actions/upload-artifact@v3
669-
with:
670-
name: package-deployment
671-
path: build/package/deployment**
672-
if: ${{ !cancelled() }}
673682
674683
build-3_9:
675684
runs-on: ubuntu-latest
@@ -2700,13 +2709,6 @@ jobs:
27002709
git_committer_email: ${{ secrets.SA_GH_USER_EMAIL }}
27012710
gpg_private_key: ${{ secrets.SA_GPG_PRIVATE_KEY }}
27022711
passphrase: ${{ secrets.SA_GPG_PASSPHRASE }}
2703-
- name: Download package-deployment
2704-
if: ${{ steps.semantic.outputs.new_release_published == 'true' }}
2705-
uses: actions/download-artifact@v3
2706-
id: download-package-deployment
2707-
with:
2708-
name: package-deployment
2709-
path: download/artifacts/
27102712
- name: Download package-splunkbase
27112713
if: ${{ steps.semantic.outputs.new_release_published == 'true' }}
27122714
uses: actions/download-artifact@v3

0 commit comments

Comments
 (0)