From aada6882fff2f4c7cb6d3c2cfc83d07b22361b7f Mon Sep 17 00:00:00 2001 From: tom Date: Tue, 31 Oct 2023 13:45:08 -0300 Subject: [PATCH] integrate workflow into release process --- .github/workflows/checks.yml | 22 +++++++++++----------- .github/workflows/pre-release.yml | 5 +++++ .github/workflows/release.yml | 6 ++++++ .github/workflows/upload-source-maps.yml | 6 ++---- 4 files changed, 24 insertions(+), 15 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 98a9f1e33c..3a061040a8 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -2,17 +2,17 @@ name: Checks on: workflow_call: workflow_dispatch: - # pull_request: - # types: [ opened, synchronize, unlabeled ] - # paths-ignore: - # - '.github/ISSUE_TEMPLATE/**' - # - '.husky/**' - # - '.vscode/**' - # - 'deploy/**' - # - 'docs/**' - # - 'public/**' - # - 'stub/**' - # - 'tools/**' + pull_request: + types: [ opened, synchronize, unlabeled ] + paths-ignore: + - '.github/ISSUE_TEMPLATE/**' + - '.husky/**' + - '.vscode/**' + - 'deploy/**' + - 'docs/**' + - 'public/**' + - 'stub/**' + - 'tools/**' # concurrency: # group: ${{ github.workflow }}__${{ github.job }}__${{ github.ref }} diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index fc7c85d427..94aaac7b1c 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -32,3 +32,8 @@ jobs: label_name: 'pre-release' label_description: Tasks in pre-release right now secrets: inherit + + upload_source_maps: + name: Upload source maps to Sentry + uses: './.github/workflows/upload-source-maps.yml' + secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eea62fafd2..bbb3f07448 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -78,3 +78,9 @@ jobs: name: Publish Docker image uses: './.github/workflows/publish-image.yml' secrets: inherit + + upload_source_maps: + name: Upload source maps to Sentry + needs: publish_image + uses: './.github/workflows/upload-source-maps.yml' + secrets: inherit diff --git a/.github/workflows/upload-source-maps.yml b/.github/workflows/upload-source-maps.yml index cd5842df5b..95acd14f9e 100644 --- a/.github/workflows/upload-source-maps.yml +++ b/.github/workflows/upload-source-maps.yml @@ -2,11 +2,8 @@ name: Upload source maps to Sentry on: workflow_call: workflow_dispatch: - pull_request: - types: [ opened, synchronize ] env: - NEXT_PUBLIC_GIT_TAG: v1.16.0 SENTRY_ORG: ${{ vars.SENTRY_ORG }} SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT }} SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} @@ -16,6 +13,7 @@ jobs: build_and_upload: name: Build app with source maps and upload to Sentry runs-on: ubuntu-latest + if: ${{ github.ref_type == 'tag' }} steps: - name: Checkout repo uses: actions/checkout@v3 @@ -48,4 +46,4 @@ jobs: run: yarn sentry-cli sourcemaps inject ./.next - name: Upload source maps to Sentry - run: yarn sentry-cli sourcemaps upload --release=${{ env.NEXT_PUBLIC_GIT_TAG }} --validate ./.next \ No newline at end of file + run: yarn sentry-cli sourcemaps upload --release=${{ github.ref_name }} --validate ./.next \ No newline at end of file