Skip to content

Commit

Permalink
Add unsigned archive (#41)
Browse files Browse the repository at this point in the history
* Add unsigned archive

* Update zip exclude

* Updates

* Fix CI

* Fix CI

* Update CHANGELOG.md
  • Loading branch information
mikhail-vl authored Jul 10, 2024
1 parent d48dc20 commit fb953f7
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 7 deletions.
26 changes: 24 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,34 @@ jobs:
export GRAFANA_PLUGIN_ID=$(cat dist/plugin.json | jq -r .id)
export GRAFANA_PLUGIN_VERSION=$(cat dist/plugin.json | jq -r .info.version)
export GRAFANA_PLUGIN_TYPE=$(cat dist/plugin.json | jq -r .type)
export GRAFANA_PLUGIN_ARTIFACT=${GRAFANA_PLUGIN_ID}-${GRAFANA_PLUGIN_VERSION}.zip
export GRAFANA_PLUGIN_ARTIFACT_CHECKSUM=${GRAFANA_PLUGIN_ARTIFACT}.md5
export GRAFANA_PLUGIN_ARTIFACT_UNSIGNED=${GRAFANA_PLUGIN_ID}-${GRAFANA_PLUGIN_VERSION}.unsigned.zip
export GRAFANA_PLUGIN_ARTIFACT_UNSIGNED_CHECKSUM=${GRAFANA_PLUGIN_ARTIFACT}.unsigned.md5
echo "plugin-id=${GRAFANA_PLUGIN_ID}" >> $GITHUB_OUTPUT
echo "plugin-version=${GRAFANA_PLUGIN_VERSION}" >> $GITHUB_OUTPUT
echo "plugin-type=${GRAFANA_PLUGIN_TYPE}" >> $GITHUB_OUTPUT
echo "archive=${GRAFANA_PLUGIN_ARTIFACT}" >> $GITHUB_OUTPUT
echo "archive-unsigned=${GRAFANA_PLUGIN_ARTIFACT_UNSIGNED}" >> $GITHUB_OUTPUT
echo "archive-checksum=${GRAFANA_PLUGIN_ARTIFACT_CHECKSUM}" >> $GITHUB_OUTPUT
echo "archive-unsigned-checksum=${GRAFANA_PLUGIN_ARTIFACT_UNSIGNED_CHECKSUM}" >> $GITHUB_OUTPUT
- name: Package plugin
id: package-plugin
run: |
mv dist ${{ steps.metadata.outputs.plugin-id }}
zip ${{ steps.metadata.outputs.archive }} ${{ steps.metadata.outputs.plugin-id }} -r
md5sum ${{ steps.metadata.outputs.archive }} > ${{ steps.metadata.outputs.archive-checksum }}
echo "checksum=$(cat ./${{ steps.metadata.outputs.archive-checksum }} | cut -d' ' -f1)" >> $GITHUB_OUTPUT
zip ${{ steps.metadata.outputs.archive-unsigned }} ${{ steps.metadata.outputs.plugin-id }} -r -x ${{ steps.metadata.outputs.plugin-id }}/MANIFEST.txt
md5sum ${{ steps.metadata.outputs.archive-unsigned }} > ${{ steps.metadata.outputs.archive-unsigned-checksum }}
echo "checksum=$(cat ./${{ steps.metadata.outputs.archive-unsigned-checksum }} | cut -d' ' -f1)" >> $GITHUB_OUTPUT
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
Expand All @@ -99,3 +109,15 @@ jobs:
with:
name: ${{ steps.metadata.outputs.archive-checksum }}
path: ${{ steps.metadata.outputs.archive-checksum }}

- name: Upload unsigned artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.metadata.outputs.archive-unsigned }}
path: ${{ steps.metadata.outputs.archive-unsigned }}

- name: Upload unsigned artifact checksum
uses: actions/upload-artifact@v4
with:
name: ${{ steps.metadata.outputs.archive-unsigned-checksum }}
path: ${{ steps.metadata.outputs.archive-unsigned-checksum }}
16 changes: 14 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,20 @@ jobs:
export GRAFANA_PLUGIN_ID=$(cat dist/plugin.json | jq -r .id)
export GRAFANA_PLUGIN_VERSION=$(cat dist/plugin.json | jq -r .info.version)
export GRAFANA_PLUGIN_TYPE=$(cat dist/plugin.json | jq -r .type)
export GRAFANA_PLUGIN_ARTIFACT=${GRAFANA_PLUGIN_ID}-${GRAFANA_PLUGIN_VERSION}.zip
export GRAFANA_PLUGIN_ARTIFACT_CHECKSUM=${GRAFANA_PLUGIN_ARTIFACT}.md5
export GRAFANA_PLUGIN_ARTIFACT_UNSIGNED=${GRAFANA_PLUGIN_ID}-${GRAFANA_PLUGIN_VERSION}.unsigned.zip
export GRAFANA_PLUGIN_ARTIFACT_UNSIGNED_CHECKSUM=${GRAFANA_PLUGIN_ARTIFACT}.unsigned.md5
echo "plugin-id=${GRAFANA_PLUGIN_ID}" >> $GITHUB_OUTPUT
echo "plugin-version=${GRAFANA_PLUGIN_VERSION}" >> $GITHUB_OUTPUT
echo "plugin-type=${GRAFANA_PLUGIN_TYPE}" >> $GITHUB_OUTPUT
echo "archive=${GRAFANA_PLUGIN_ARTIFACT}" >> $GITHUB_OUTPUT
echo "archive-unsigned=${GRAFANA_PLUGIN_ARTIFACT_UNSIGNED}" >> $GITHUB_OUTPUT
echo "archive-checksum=${GRAFANA_PLUGIN_ARTIFACT_CHECKSUM}" >> $GITHUB_OUTPUT
echo "archive-unsigned-checksum=${GRAFANA_PLUGIN_ARTIFACT_UNSIGNED_CHECKSUM}" >> $GITHUB_OUTPUT
echo "github-tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
Expand All @@ -77,10 +82,15 @@ jobs:
id: package-plugin
run: |
mv dist ${{ steps.metadata.outputs.plugin-id }}
zip ${{ steps.metadata.outputs.archive }} ${{ steps.metadata.outputs.plugin-id }} -r
md5sum ${{ steps.metadata.outputs.archive }} > ${{ steps.metadata.outputs.archive-checksum }}
echo "checksum=$(cat ./${{ steps.metadata.outputs.archive-checksum }} | cut -d' ' -f1)" >> $GITHUB_OUTPUT
zip ${{ steps.metadata.outputs.archive-unsigned }} ${{ steps.metadata.outputs.plugin-id }} -r -x ${{ steps.metadata.outputs.plugin-id }}/MANIFEST.txt
md5sum ${{ steps.metadata.outputs.archive-unsigned }} > ${{ steps.metadata.outputs.archive-unsigned-checksum }}
echo "checksum=$(cat ./${{ steps.metadata.outputs.archive-unsigned-checksum }} | cut -d' ' -f1)" >> $GITHUB_OUTPUT
- name: Create release
id: create_release
uses: softprops/action-gh-release@v1
Expand All @@ -93,3 +103,5 @@ jobs:
files: |
./${{ steps.metadata.outputs.archive }}
./${{ steps.metadata.outputs.archive-checksum }}
./${{ steps.metadata.outputs.archive-unsigned }}
./${{ steps.metadata.outputs.archive-unsigned-checksum }}
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# Changelog

## 4.0.0 (IN PROGRESS)
## 4.0.0 (2024-07-10)

### Breaking changes

- Requires Grafana 10 and Grafana 11

### Features / Enhancements

- Add plugin e2e tests and remove cypress (#35)
- Added plugin e2e tests and remove cypress (#35)
- Updated E2E tests to use Docker (#39)
- Update Grafana 11 dependencies (#40)
- Updated Grafana 11 dependencies (#40)
- Updated workflow actions (#40)
- Added unsigned archive (#41)

## 3.1.0 (2023-10-13)

Expand Down

0 comments on commit fb953f7

Please sign in to comment.