oncall-engine/.github/actions/build-sign-and-package-plugin/action.yml
Dominik Broj 9bbd2c4db0
chore: Switch to pnpm + adjust to IRM (#4969)
# What this PR does
- switch to pnpm
- adjust to IRM

## Which issue(s) this PR closes

Related to:
https://github.com/grafana/irm/issues/12
https://github.com/grafana/irm/issues/11
https://github.com/grafana/irm/issues/66

<!--
*Note*: If you want the issue to be auto-closed once the PR is merged,
change "Related to" to "Closes" in the line above.
If you have more than one GitHub issue that this PR closes, be sure to
preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-09-02 12:48:23 +00:00

51 lines
1.9 KiB
YAML

name: Build, sign, and package plugin
description: Build, sign, and package plugin
inputs:
plugin_version_number:
description: "The version number of the plugin"
required: true
grafana_access_policy_token:
description: "The Grafana access policy token used to sign the plugin"
required: true
working_directory:
description: "The working directory of the plugin"
required: true
is_enterprise:
description: "Whether the plugin is an enterprise build or not"
required: false
default: "false"
outputs:
artifact_filename:
description: "The filename of the plugin artifact"
value: ${{ steps.artifact-filename.outputs.filename }}
runs:
using: "composite"
steps:
- name: Determine artifact filename
shell: bash
id: artifact-filename
# yamllint disable rule:line-length
run: |
echo filename="grafana-oncall${{ inputs.is_enterprise == 'true' && '-ee' || '' }}-app-${{ inputs.plugin_version_number }}.zip" >> $GITHUB_OUTPUT
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: "1.21.5"
- name: Install Mage
shell: bash
run: go install github.com/magefile/mage@v1.15.0
- name: Build, sign, and package plugin
shell: bash
working-directory: ${{ inputs.working_directory }}
env:
GRAFANA_ACCESS_POLICY_TOKEN: ${{ inputs.grafana_access_policy_token }}
run: |
jq --arg v "${{ inputs.plugin_version_number }}" '.version=$v' package.json > package.new && mv package.new package.json && jq '.version' package.json;
pnpm build
mage buildAll || true
pnpm sign
if [ ! -f dist/MANIFEST.txt ]; then echo "Sign failed, MANIFEST.txt not created, aborting." && exit 1; fi
mv dist grafana-oncall-app
zip -r grafana-oncall-app.zip ./grafana-oncall-app
cp grafana-oncall-app.zip ${{ steps.artifact-filename.outputs.filename }}
# yamllint enable rule:line-length