Skip to content

Commit

Permalink
ci: Make nightly release
Browse files Browse the repository at this point in the history
* Build artifacts are not publicly available.

* We need to give a link to download plugin for review and so make nightly release for each push event

* Write permissions are needed for workflows that need to publish

* Run nightly release on PR merge event

* Also run it on every push event on main

Signed-off-by: Mahendra Paipuri <mahendra.paipuri@gmail.com>
  • Loading branch information
mahendrapaipuri committed Jan 18, 2024
1 parent 4c466d6 commit 3fb53d8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
jobs:
build:
runs-on: ubuntu-latest
# For nightly build releases
permissions:
contents: write
steps:
- uses: actions/checkout@v3

Expand Down Expand Up @@ -72,3 +75,28 @@ jobs:

- name: Stop grafana docker
run: docker-compose down

- name: Package plugin
run: |
pushd dist
tar -czvf ../grafana-dashboard-reporter-app.tar.gz *
popd
sha256sum grafana-dashboard-reporter-app.tar.gz > grafana-dashboard-reporter-app.sha256
- name: Release nightly
uses: softprops/action-gh-release@v1
# Run this only when there is a PR merged or on main branch
if: github.event.pull_request.merged || github.ref == 'refs/heads/main'
with:
prerelease: true
name: nightly
tag_name: nightly
files: |
grafana-dashboard-reporter-app.tar.gz
grafana-dashboard-reporter-app.sha256
fail_on_unmatched_files: true
body: |
# Latest Build Complete! :rocket:
For the public download links of these build artifacts, please see:
<https://github.com/mahendrapaipuri/grafana-dashboard-reporter-app/releases/tag/nightly>
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
env:
GRAFANA_API_KEY: ${{ secrets.GRAFANA_ACCESS_POLICY_TOKEN }} # Requires a Grafana access policy token from Grafana.com.
steps:
Expand Down

0 comments on commit 3fb53d8

Please sign in to comment.