ci: create Sentry release on publish (#7362)

Explicitly creating the Sentry release allows us to associate the
commits since the last release with the new one. This might help us to
identify potential sources of regressions. For the current releases,
I've set them manually to ensure that this automation has something to
pick up on for the next release.

The releases will already exists prior to this because they are
automatically created when a client / gateway first logs in with a
certain version.

What this does it mark it as "finalized" and set the commit range
accordingly.

Resolves: #7358.

---------

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
This commit is contained in:
Thomas Eizinger
2024-11-18 20:39:43 +00:00
committed by GitHub
parent b5b0ee2090
commit f04bf6bd6d
2 changed files with 79 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
---
name: "Create Sentry release"
description: "Creates a Sentry release for projects from a particular Git tag"
inputs:
component:
description: "The component to create a release for"
required: true
# e.g. "gateway", "gui-client", "headless-client", ...
projects:
description: "The Sentry projects to create a release for"
required: true
# Must be space-separated.
runs:
using: "composite"
steps:
- name: Extract semantic version from release name
id: version
run: |
version=${{ github.event.release.name }}
version=${version#${{ inputs.component }}-}
echo "version=$version" >> $GITHUB_OUTPUT
shell: bash
- uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: firezone-inc
with:
version: ${{ steps.version.outputs.version }}
projects: ${{ inputs.projects }}
set_commits: auto

47
.github/workflows/sentry.yml vendored Normal file
View File

@@ -0,0 +1,47 @@
name: Create Sentry releases
run-name: Triggered by ${{ github.actor }}
on:
release:
types:
- published
concurrency:
group: "publish-production-${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: false
jobs:
create_gateway_sentry_release:
if: ${{ startsWith(github.event.release.name, 'gateway') }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/create-sentry-release
with:
component: gateway
projects: gateway
create_gui-client_sentry_release:
if: ${{ startsWith(github.event.release.name, 'gui-client') }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/create-sentry-release
with:
component: gui-client
projects: gui-client-gui gui-client-ipc-service
create_headless-client_sentry_release:
if: ${{ startsWith(github.event.release.name, 'headless-client') }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/create-sentry-release
with:
component: headless-client
projects: headless-client