Merge pull request #113 from IBM/staging/v1.x #178
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: Enable Corepack | |
run: corepack enable | |
- 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@v5 | |
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: latest | |
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@v2 | |
with: | |
prerelease: false | |
draft: true | |
files: | | |
build/ibm-rmf-grafana-* | |
ibm-rmf-grafana-*.zip.asc | |
body_path: RELEASE_NOTES.md |