Skip to content

Commit

Permalink
Update release CI
Browse files Browse the repository at this point in the history
  • Loading branch information
diericd committed May 27, 2024
1 parent 80d6ba6 commit c8f54d0
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 58 deletions.
32 changes: 32 additions & 0 deletions .github/actions/pnpm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: 'Setup pnpm'
description: 'Sets up pnpm for use in other actions'

runs:
using: 'composite'
steps:
- uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 8.6.2
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile
27 changes: 1 addition & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,7 @@ jobs:
GRAFANA_ACCESS_POLICY_TOKEN: ${{ secrets.GRAFANA_ACCESS_POLICY_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 8.6.2
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- uses: ./.github/actions/pnpm

- name: Check types
run: pnpm run typecheck
Expand Down
26 changes: 1 addition & 25 deletions .github/workflows/is-compatible.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 8.6.2
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- uses: ./.github/actions/pnpm
- name: Build plugin
run: pnpm run build
- name: Compatibility check
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/pnpm
- uses: grafana/plugin-actions/build-plugin@release
# Uncomment to enable plugin signing
# (For more info on how to generate the access policy token see https://grafana.com/developers/plugin-tools/publish-a-plugin/sign-a-plugin#generate-an-access-policy-token)
#with:
# Make sure to save the token in your repository secrets
#policy_token: $
# Usage of GRAFANA_API_KEY is deprecated, prefer `policy_token` option above
#grafana_token: $
with:
policy_token: ${{ secrets.GRAFANA_POLICY_TOKEN }}

0 comments on commit c8f54d0

Please sign in to comment.