Fix static analysis issues and amend CI #2
Workflow file for this run
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
name: ibm-rmf-grafana | |
on: | |
push: | |
branches: | |
- 'staging/v*' | |
- 'release/v*' | |
tags: | |
- 'ibm-rmf-grafana/v*' | |
pull_request: | |
branches: | |
- 'staging/v*' | |
- 'release/v*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: grafana/rmf-app | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: grafana/rmf-app/.nvmrc | |
cache: 'yarn' | |
cache-dependency-path: 'grafana/rmf-app/yarn.lock' | |
- name: Setup Golang | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: grafana/rmf-app/go.mod | |
cache-dependency-path: grafana/rmf-app/go.sum | |
- name: Test | |
run: make test | |
- name: Lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: v1.58 | |
only-new-issues: true | |
working-directory: grafana/rmf-app | |
- name: Build | |
run: make all | |
- name: Fetch Release Notes | |
id: changelog | |
run: | | |
awk '/^## / {s++} s == 1 {print}' CHANGELOG.md > RELEASE_NOTES.md | |
- name: Upload Build | |
uses: actions/upload-artifact@v4 | |
with: | |
name: rmf-app-grafana | |
path: | | |
grafana/rmf-app/RELEASE_NOTES.md | |
grafana/rmf-app/build/ibm-rmf-grafana-* | |
sign: | |
runs-on: code-sign | |
needs: build | |
if: startsWith(github.ref, 'refs/tags/ibm-rmf-grafana/v') | |
steps: | |
- name: Download Build | |
uses: actions/download-artifact@v4 | |
with: | |
name: rmf-app-grafana | |
- name: Sign | |
run: | | |
$env:Path = 'C:\Program Files (x86)\Garantir\GRS;' + $env:Path | |
gpg-agent | |
gpg --detach-sign -a build/ibm-rmf-grafana-*.zip | |
- name: Upload Signature | |
uses: actions/upload-artifact@v4 | |
with: | |
name: rmf-app-grafana-signature | |
path: build/ibm-rmf-grafana-*.zip.asc | |
- name: Clean up | |
run: rm -r -force * | |
release: | |
runs-on: ubuntu-latest | |
needs: sign | |
if: startsWith(github.ref, 'refs/tags/ibm-rmf-grafana/v') | |
steps: | |
- name: Download Build | |
uses: actions/download-artifact@v4 | |
with: | |
name: rmf-app-grafana | |
- name: Download Signature | |
uses: actions/download-artifact@v4 | |
with: | |
name: rmf-app-grafana-signature | |
- name: Release Draft | |
uses: softprops/action-gh-release@v1 | |
with: | |
prerelease: false | |
draft: true | |
files: | | |
build/ibm-rmf-grafana-* | |
ibm-rmf-grafana-*.zip.asc | |
body_path: RELEASE_NOTES.md |