diff --git a/.github/actions/create-sentry-release/action.yml b/.github/actions/create-sentry-release/action.yml new file mode 100644 index 000000000..fd7050bf0 --- /dev/null +++ b/.github/actions/create-sentry-release/action.yml @@ -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 diff --git a/.github/workflows/sentry.yml b/.github/workflows/sentry.yml new file mode 100644 index 000000000..31ad19b9d --- /dev/null +++ b/.github/workflows/sentry.yml @@ -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