-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9712837
commit c1168b0
Showing
2 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: "Package Plugin" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Setup Go environment | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.21" | ||
|
||
- name: Install yarn dependencies | ||
run: yarn install | ||
env: | ||
NODE_OPTIONS: '--max_old_space_size=4096' | ||
|
||
- name: Build Frontend | ||
run: yarn build | ||
env: | ||
NODE_OPTIONS: '--max_old_space_size=4096' | ||
|
||
- name: Test backend | ||
uses: magefile/mage-action@v3 | ||
with: | ||
version: latest | ||
args: coverage | ||
|
||
- name: Build backend | ||
uses: magefile/mage-action@v3 | ||
with: | ||
version: latest | ||
args: buildAll | ||
|
||
- name: Get plugin metadata | ||
id: metadata | ||
run: | | ||
sudo apt-get install jq | ||
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_SHA1SUM=${GRAFANA_PLUGIN_ARTIFACT}.sha1 | ||
|
||
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-sha1sum=${GRAFANA_PLUGIN_ARTIFACT_SHA1SUM}" >> $GITHUB_OUTPUT | ||
|
||
echo "github-tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | ||
shell: bash | ||
|
||
- 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 | ||
sha1sum ${{ steps.metadata.outputs.archive }} | cut -f1 -d' ' > ${{ steps.metadata.outputs.archive-sha1sum }} | ||
shell: bash | ||
|
||
- name: Archive plugin build artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: grafana-questdb-datasource.zip | ||
path: ${{ steps.metadata.outputs.archive }} | ||
retention-days: 7 |
File renamed without changes.