Skip to content

Website: Fix footer links for dev portal (#336) #516

Website: Fix footer links for dev portal (#336)

Website: Fix footer links for dev portal (#336) #516

Workflow file for this run

name: Node CI
on: [push]
jobs:
test:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
name: Run unit tests
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
# We need to fetch all branches and commits so that Nx affected has a base to compare against.
fetch-depth: 0
- uses: nrwl/nx-set-shas@v3
- name: Setup .npmrc file for NPM registry
uses: actions/setup-node@v3
with:
node-version: '16'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Check types
run: npm exec nx affected -- --target typecheck --parallel
- name: Lint
run: npm exec nx affected -- --target lint --parallel
- name: Unit tests
run: npm exec nx affected -- --target test --ci
- name: Build all packages
run: npm run build
- name: Restore cached generated plugin dependencies
id: cache-generated-deps-restore
uses: actions/cache/restore@v3
with:
path: |
./packages/create-plugin/generated/package-lock.json
./packages/create-plugin/generated/node_modules
key: ${{ runner.os }}-generated-plugin-deps
- name: '@grafana/create-plugin - test an app plugin generation'
run: npm exec nx run @grafana/create-plugin:generate-app && (cd ./packages/create-plugin/generated && npm install && npm run build && npm run lint)
- name: '@grafana/create-plugin - test an app with backend plugin generation'
run: npm exec nx run @grafana/create-plugin:generate-app-backend && (cd ./packages/create-plugin/generated && npm install && npm run build && npm run lint)
- name: '@grafana/create-plugin - test panel plugin generation'
run: npm exec nx run @grafana/create-plugin:generate-panel && (cd ./packages/create-plugin/generated && npm install && npm run build && npm run lint)
- name: '@grafana/create-plugin - test datasource plugin generation'
run: npm exec nx run @grafana/create-plugin:generate-datasource && (cd ./packages/create-plugin/generated && npm install && npm run build && npm run lint)
- name: '@grafana/create-plugin - test datasource with backend plugin generation'
run: npm exec nx run @grafana/create-plugin:generate-datasource-backend && (cd ./packages/create-plugin/generated && npm install && npm run build && npm run lint)
- name: '@grafana/create-plugin - test scenes app plugin generation'
run: npm exec nx run @grafana/create-plugin:generate-scenes-app && (cd ./packages/create-plugin/generated && npm install && npm run build && npm run lint)
- name: Save generated plugin dependencies
id: cache-generated-deps-save
if: steps.cache-generated-deps-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: |
./packages/create-plugin/generated/package-lock.json
./packages/create-plugin/generated/node_modules
key: ${{ steps.cache-generated-deps-restore.outputs.cache-primary-key }}
- name: '@grafana/sign-plugin - use GRAFANA_ACCESS_POLICY_TOKEN to sign generated plugin'
env:
GRAFANA_ACCESS_POLICY_TOKEN: ${{ secrets.GRAFANA_ACCESS_POLICY_TOKEN }}
run: node ../../sign-plugin/dist/bin/run.js --rootUrls http://www.example.com --signatureType private
working-directory: ./packages/create-plugin/generated
- name: '@grafana/sign-plugin - use GRAFANA_API_KEY to sign generated plugin'
env:
GRAFANA_API_KEY: ${{ secrets.GRAFANA_API_KEY }}
run: node ../../sign-plugin/dist/bin/run.js --rootUrls http://www.example.com --signatureType private
working-directory: ./packages/create-plugin/generated
release:
runs-on: ubuntu-latest
needs: test
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
name: Release packages
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PEM }}
- uses: actions/checkout@v3
with:
token: ${{ steps.generate_token.outputs.token }}
- name: Prepare repository
run: git fetch --unshallow --tags
- name: Setup environment
uses: actions/setup-node@v3
with:
node-version: '16'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Create Release
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: npm run release