license link #5
This file contains hidden or 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
| name: PROD Plugin Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| cache: 'yarn' | |
| - name: Install dependencies | |
| run: yarn install --immutable --prefer-offline | |
| - name: Build and test frontend | |
| id: build | |
| run: yarn build | |
| - name: Get plugin metadata | |
| id: metadata | |
| run: | | |
| sudo apt-get install jq | |
| export KENSOBI_PLUGIN_ID=$(cat dist/plugin.json | jq -r .id) | |
| export KENSOBI_PLUGIN_VERSION=$(cat dist/plugin.json | jq -r .info.version) | |
| export KENSOBI_PLUGIN_TYPE=$(cat dist/plugin.json | jq -r .type) | |
| export KENSOBI_PLUGIN_ARTIFACT=${KENSOBI_PLUGIN_ID}-${KENSOBI_PLUGIN_VERSION}.zip | |
| export KENSOBI_PLUGIN_ARTIFACT_CHECKSUM=${KENSOBI_PLUGIN_ARTIFACT}.md5 | |
| echo "plugin-id=${KENSOBI_PLUGIN_ID}" >> $GITHUB_OUTPUT | |
| echo "plugin-version=${KENSOBI_PLUGIN_VERSION}" >> $GITHUB_OUTPUT | |
| echo "plugin-type=${KENSOBI_PLUGIN_TYPE}" >> $GITHUB_OUTPUT | |
| echo "archive=${KENSOBI_PLUGIN_ARTIFACT}" >> $GITHUB_OUTPUT | |
| echo "archive-checksum=${KENSOBI_PLUGIN_ARTIFACT_CHECKSUM}" >> $GITHUB_OUTPUT | |
| echo "github-tag=${GITHUB_REF#refs/*/}" >> $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 | |
| - name: Create Github release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.metadata.outputs.plugin-version }} | |
| draft: false | |
| generate_release_notes: true | |
| files: | | |
| ./${{ steps.metadata.outputs.archive }} | |
| ./${{ steps.metadata.outputs.archive-checksum }} | |
| body: | | |
| Release notes |