From fb953f7dc9969afe7f4c3fd85d068db868d0b7b3 Mon Sep 17 00:00:00 2001 From: Mikhail Volkov <47795110+mikhail-vl@users.noreply.github.com> Date: Wed, 10 Jul 2024 19:51:09 -0400 Subject: [PATCH] Add unsigned archive (#41) * Add unsigned archive * Update zip exclude * Updates * Fix CI * Fix CI * Update CHANGELOG.md --- .github/workflows/ci.yml | 26 ++++++++++++++++++++++++-- .github/workflows/release.yml | 16 ++++++++++++++-- CHANGELOG.md | 7 ++++--- 3 files changed, 42 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c61a7a3..6e60ec6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a79a858..9dabbe5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 @@ -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 }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 84a26e0..5c54ce2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 4.0.0 (IN PROGRESS) +## 4.0.0 (2024-07-10) ### Breaking changes @@ -8,10 +8,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)