Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release: Add release-please to prepare future releases. #101

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
name: CI
on:
pull_request: ~
push:
branches:
- master

jobs:
linters:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2

- name: Install devbox
uses: jetify-com/[email protected]
uses: jetify-com/devbox-install-action@a03caf5813591bc882139eba6ae947930a83a427 #v0.11.0
with:
enable-cache: 'true'

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dashboards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Get changed dashboards
id: changed-files
uses: tj-actions/changed-files@v41
uses: tj-actions/changed-files@4edd678ac3f81e2dc578756871e4d00c19191daf #v45.0.4
with:
files: dashboards/**.json

Expand All @@ -36,4 +36,4 @@ jobs:
GRAFANA_INSTANCE_URL: ${{ secrets.GRAFANA_INSTANCE_URL }}
GRAFANA_API_TOKEN: ${{ secrets.GRAFANA_API_TOKEN }}
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}


51 changes: 29 additions & 22 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,49 @@
on:
push:
tags:
- "*"
branches:
- main

# These permissions are needed to assume roles from Github's OIDC.
# These permissions are needed to assume roles from GitHub's OIDC.
permissions:
contents: write
id-token: write
pull-requests: write

name: Publish Extension
jobs:
lint:
release-please:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
outputs:
release_created: "${{ steps.release-please.outputs.release_created }}"
release_tag: "${{ steps.release-please.outputs.tag_name }}"

- name: Install devbox
uses: jetify-com/[email protected]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
enable-cache: 'true'

- name: Install vendors
run: devbox run yarn install --frozen-lockfile

- name: Compile codebase
run: devbox run yarn run compile
# https://github.com/actions/checkout/issues/1467
fetch-depth: 0

- name: Run linters
run: devbox run yarn run lint
- uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f # v4.1.3
id: release-please
with:
release-type: node
github-token: ${{ github.secret }}
config-file: .release-please.json

publish:
needs: lint
needs: release-please
if: needs.release-please.outputs.release_created

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
fetch-depth: 0
ref: "${{ needs.release-please.outputs.release_tag }}"


- name: Install devbox
uses: jetify-com/[email protected]
uses: jetify-com/devbox-install-action@a03caf5813591bc882139eba6ae947930a83a427 #v0.11.0
with:
enable-cache: 'true'

Expand All @@ -61,9 +67,10 @@ jobs:
- name: Publish to Visual Studio Marketplace
run: devbox run vsce publish --pat ${{ env.VS_MARKETPLACE_TOKEN }} --packagePath grafana-vscode.vsix

- name: Create GitHub release
uses: ncipollo/release-action@v1
- name: Create artifacts
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
with:
allowUpdates: true
tag: ${{ needs.generate-release.outputs.release_tag }}
artifacts: "grafana-vscode.vsix"
token: ${{ secrets.GITHUB_TOKEN }}
60 changes: 60 additions & 0 deletions .release-please.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"pull-request-title-pattern": "Automatic release v${{ version }} 🚀",
"bump-minor-pre-major": true,
"include-v-in-tag": true,
"draft-pull-request": true,
"changelog-sections": [
{
"section": "🎉 Features",
"type": "feat"
},
{
"section": "🐛 Bug Fixes",
"type": "fix"
},
{
"section": "⚡ Performance Improvements",
"type": "perf"
},
{
"section": "🔗 Dependencies",
"type": "deps"
},
{
"section": "📝 Documentation",
"type": "docs"
},
{
"section": "🏗️ Build System",
"type": "build"
},
{
"section": "🤖 Continuous Integration",
"type": "ci"
},
{
"section": "🔧 Miscellaneous Chores",
"type": "chore"
},
{
"section": "⏪ Reverts",
"type": "revert"
},
{
"section": "✅ Tests",
"type": "test"
},
{
"section": "💄 Style",
"type": "style"
},
{
"section": "♻️ Code Refactoring",
"type": "refactor"
}
],
"packages": {
".": {}
}
}