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 4 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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ jobs:
linters:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2

- name: Install devbox
uses: jetify-com/devbox-install-action@v0.11.0
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 }}


68 changes: 59 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,66 @@
on:
push:
tags:
- "*"
branches:
- main

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

name: Publish Extension
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: "${{ steps.release-please.outputs.release_created }}"
release_tag: "${{ steps.release-please.outputs.tag_name }}"

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
# https://github.com/actions/checkout/issues/1467
fetch-depth: 0

- uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f # v4.1.3
id: release-please
with:
release-type: node
default-branch: main
pull-request-title-pattern: "Automatic release v${{ version }} 🚀"
github-token: ${{ github.secret }}
bump-minor-pre-major: true # Avoids to generate a major version. Remove when necessary
include-v-in-tag: true
draft-pull-request: true
changelog-types:
feat: "🎉 Features"
fix: "🐛 Bug Fixes"
deps: "🔗 Dependencies"
docs: "📝 Documentation"
ci: "🤖 Continuous Integration"
refactor: "♻️ Code Refactoring"
test: "✅ Tests"
revert: "⏪ Reverts"
style: "💄 Style"
build: "🏗️ Build System"
perf: "⚡ Performance Improvements"
chore: "🔧 Miscellaneous Chores"

lint:
needs: release-please
if: needs.release-please.outputs.release_created
spinillos marked this conversation as resolved.
Show resolved Hide resolved

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

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

Expand All @@ -30,14 +74,19 @@ jobs:
run: devbox run yarn run lint

publish:
needs: lint
needs: [lint, 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/devbox-install-action@v0.11.0
uses: jetify-com/devbox-install-action@a03caf5813591bc882139eba6ae947930a83a427 #v0.11.0
with:
enable-cache: 'true'

Expand All @@ -61,9 +110,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 }}