Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove artifact-registry #226

Merged
merged 3 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 1 addition & 77 deletions .github/workflows/reusable-build-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ jobs:
if: ${{ needs.setup-workflow.outputs.skip-workflow != 'Yes' }}
steps:
- uses: actions/checkout@v3
- name: run fossa anlyze and create report
- name: run fossa analyze and create report
run: |
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install-latest.sh | bash
fossa analyze --debug
Expand Down Expand Up @@ -836,82 +836,6 @@ jobs:
name: appinspect-api-html-report-${{ matrix.tags }}
path: AppInspect_response.html

artifact-registry:
runs-on: ubuntu-latest
needs:
- meta
- build
if: ${{ !cancelled() && needs.build.result == 'success' && needs.meta.result == 'success' }}
outputs:
artifact: ${{ steps.artifactid.outputs.result }}
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: package-splunkbase
path: build/package/splunkbase
- id: getappid
run: |
appid=$(jq -r '.info.id.name' package/app.manifest)
echo appid="$appid"
echo "result=$appid" >> "$GITHUB_OUTPUT"
- run: |
curl -LO https://github.com/oras-project/oras/releases/download/v0.12.0/oras_0.12.0_linux_amd64.tar.gz
mkdir -p oras-install/
tar -zxf oras_0.12.0_*.tar.gz -C oras-install/
mv oras-install/oras /usr/local/bin/
rm -rf oras_0.12.0_*.tar.gz oras-install/
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Packages Docker Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Docker meta
id: meta
uses: docker/[email protected]
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern=v{{major}}.{{minor}},prefix=${{ steps.getappid.outputs.result }}-
type=semver,pattern=v{{major}},prefix=${{ steps.getappid.outputs.result }}-
type=semver,pattern=v{{version}},prefix=${{ steps.getappid.outputs.result }}-
type=semver,pattern={{major}}.{{minor}},prefix=${{ steps.getappid.outputs.result }}-
type=semver,pattern={{major}},prefix=${{ steps.getappid.outputs.result }}-
type=semver,pattern={{version}},prefix=${{ steps.getappid.outputs.result }}-
type=ref,event=branch,prefix=${{ steps.getappid.outputs.result }}-
type=ref,event=pr,prefix=${{ steps.getappid.outputs.result }}-
type=sha,prefix=${{ steps.getappid.outputs.result }}-
type=sha,format=long,prefix=${{ steps.getappid.outputs.result }}-
- name: Upload artifacts
run: |
tee /tmp/tags &>/dev/null <<EOF
${{ steps.meta.outputs.tags }}
EOF
pushd build/package/splunkbase/
PACKAGE=$(ls ./*)
echo "$PACKAGE"
mv "$PACKAGE" "${{ steps.getappid.outputs.result }}".spl
while IFS= read -r line
do
echo ">>$line<<"
oras push \
--manifest-config /dev/null:application/vnd.splunk.ent.package.v1.tar+gzip \
"$line" \
"${{ steps.getappid.outputs.result }}".spl
echo " complete"
done < /tmp/tags
popd
- name: Output artifact locator
id: artifactid
run: |
echo "result= ${{ needs.meta.outputs.sc4s }}" >> "$GITHUB_OUTPUT"

setup:
needs:
- build
Expand Down
87 changes: 0 additions & 87 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,30 +411,6 @@ appinspect-api-html-report-self-service

**Action used:** NA

# artifact-registry

**Description:**

- Uploads the generated addon build to ghcr.io.

**Action used:**

- https://github.com/actions/download-artifact
- https://github.com/docker/setup-buildx-action
- https://github.com/docker/login-action

**Artifacts:**

- No Artifacts

- This build can be downloaded using oras if it’s not availale in ghcr yet

- User can use the following command to download build for the respective PR

```
oras pull -u <github-username> -p <github-token> ghcr.io/splunk/splunk-add-on-for-microsoft-sql-server:Splunk_TA_microsoft-sqlserver-<PR-no>
```

# test-unit-python3

**Description:**
Expand Down Expand Up @@ -657,69 +633,6 @@ source_code.zip
source_code.tar.gz
```

Publish-untested (Publish a manual release):
============================================

**NOTE:** This stage will create a new release with the main branch code irrespective of the test-execution status hence before creating a new release via this stage make sure all stakeholders are aware before the release.

- Follow the below steps to create a manual release and publish the relevant packages:

- Go to "Actions" tab of your Github repo link.

- On the left side, you'd have **"publish-untested"** workflow mentioned. Click on this stage.

- Click on **"Run Workflow"**.

- Select the branch from which you to create the tag.

- Ideally, all our final code would be in the main branch. Hence, in majority of cases the branch would be "main" only.

- Provide the version in "Tag to release" textbox.

- Example, if you are releasing a new version v4.0.1 of your add-on, just enter **"4.0.1"** (just the dot delimited digits, do not prefix it with "v").

- Click on **"Run Workflow"**.

- Wait for a couple minutes for the build to be generated and published.

- Once the above stage completes, go to "Releases" section of your repo.

- Edit the release and write the relevant release notes you want to for your bugfix/ hotfix release and save the changes.

<img src="images/publish-untested/publish-untested.png" alt="publish-untested" style="width:200px;"/>


release-set-git-tags
====================
**Description**

- This action updates major/minor release tags on a tag push. e.g. Update v1 and v1.2 tag when released v1.2.3.

**Action used** https://github.com/haya14busa/action-update-semver


Artifacts for different stages:
================================

- Artifacts can be found in the summary if we scroll to the bottom as shown in the screenshot below. <br />
<img src="images/artifacts_all.png" alt="publish-untested" style="width:200px;"/>

- Link to the test-report for the stage can be found inside logs as shown here:

<img src="images/modinput/report_link.png" alt="report_link" style="width:200px;"/>
<img src="images/modinput/report_stage.png" alt="report_stage" style="width:200px;"/>


Different Test reports stages
=============================
- addonfactory-sample-scanner
- splunk 8.x.y knowledge test report
- splunk 8.x.y modinput_functional test report
- splunk 8.x.y ui chrome test report
- splunk 8.x.y requirement_test test report
- splunk 8.x.y unit test report


Vendor Addon Matrix tests
=========================

Expand Down
Binary file removed images/artifacts_all.png
Binary file not shown.
Binary file removed images/modinput/report_link.png
Binary file not shown.
Binary file removed images/modinput/report_stage.png
Binary file not shown.
Binary file removed images/publish-untested/publish-untested.png
Binary file not shown.
Loading