Consolidate workflows by means of reuse
This commit is contained in:
parent
8bdd965122
commit
7cc52e68d1
3 changed files with 46 additions and 37 deletions
25
.github/workflows/build.yaml
vendored
25
.github/workflows/build.yaml
vendored
|
@ -2,9 +2,22 @@ name: Build
|
||||||
on:
|
on:
|
||||||
pull_request: { }
|
pull_request: { }
|
||||||
push:
|
push:
|
||||||
branches: [ master, develop ]
|
branches: [ master ]
|
||||||
repository_dispatch:
|
workflow_call:
|
||||||
types: [ element-web-notify ]
|
inputs:
|
||||||
|
SENTRY_ORG:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
SENTRY_PROJECT:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
secrets:
|
||||||
|
SENTRY_AUTH_TOKEN:
|
||||||
|
required: true
|
||||||
|
SENTRY_DSN:
|
||||||
|
required: true
|
||||||
|
SENTRY_URL:
|
||||||
|
required: true
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: "Build"
|
name: "Build"
|
||||||
|
@ -24,6 +37,12 @@ jobs:
|
||||||
|
|
||||||
- name: Build & Package
|
- name: Build & Package
|
||||||
run: "./scripts/ci_package.sh"
|
run: "./scripts/ci_package.sh"
|
||||||
|
env:
|
||||||
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||||
|
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
||||||
|
SENTRY_URL: ${{ secrets.SENTRY_URL }}
|
||||||
|
SENTRY_ORG: ${{ inputs.SENTRY_ORG }}
|
||||||
|
SENTRY_PROJECT: ${{ inputs.SENTRY_PROJECT }}
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
|
|
24
.github/workflows/build_develop.yaml
vendored
Normal file
24
.github/workflows/build_develop.yaml
vendored
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
# Separate to the main build workflow for access to the develop
|
||||||
|
# secrets environment, reuses the build workflow for heavy lifting.
|
||||||
|
name: Build and upload sourcemaps to Sentry
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ develop ]
|
||||||
|
repository_dispatch:
|
||||||
|
types: [ element-web-notify ]
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: "Build"
|
||||||
|
environment: develop
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
# This must be set for fetchdep.sh to get the right branch
|
||||||
|
PR_NUMBER: ${{github.event.number}}
|
||||||
|
steps:
|
||||||
|
- uses: ./.github/workflows/build
|
||||||
|
secrets:
|
||||||
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||||
|
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
||||||
|
SENTRY_URL: ${{ secrets.SENTRY_URL }}
|
||||||
|
SENTRY_ORG: sentry
|
||||||
|
SENTRY_PROJECT: riot-web
|
34
.github/workflows/sentry-sourcemaps.yaml
vendored
34
.github/workflows/sentry-sourcemaps.yaml
vendored
|
@ -1,34 +0,0 @@
|
||||||
# We cannot reuse the build from the main Builder workflow
|
|
||||||
# due to needing to inject SENTRY_ env vars into ci_package.sh
|
|
||||||
# For security we harbor the secrets in a develop-only environment.
|
|
||||||
name: Sentry Sourcemaps
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- develop
|
|
||||||
repository_dispatch:
|
|
||||||
types: [ element-web-notify ]
|
|
||||||
jobs:
|
|
||||||
upload:
|
|
||||||
name: Upload
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
environment: develop
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: '14'
|
|
||||||
cache: 'yarn'
|
|
||||||
|
|
||||||
- name: Install Dependencies
|
|
||||||
run: "./scripts/layered.sh"
|
|
||||||
|
|
||||||
- name: Build & Package
|
|
||||||
run: "./scripts/ci_package.sh"
|
|
||||||
env:
|
|
||||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
||||||
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
|
||||||
SENTRY_URL: ${{ secrets.SENTRY_URL }}
|
|
||||||
SENTRY_ORG: sentry
|
|
||||||
SENTRY_PROJECT: riot-web
|
|
Loading…
Add table
Reference in a new issue