Upload source maps to sentry (#810)

* Pretend to upload source maps to sentry

* Build release not in docker so we can upload source maps sensibly

and also upload the release as a plain tarball while we're at it

* fix yaml

* Try specifying version this way

* test rebuild

* pass secrets through

* Too many sentries

* It's almost 2023 and we're still having BSD vs GNU tar issues

* Maybe get sensible tag name & release identifier

* Wrong plugin, and also try the 'release' option which might the right thing

* Try a different github action

see if github likes that any better

* add contents write permission

and switch to the asset upload plugin that had the helpful doc

* actually put release name in tarball path

* copy docker config to right path

* Prettify vite config

* Only activate sentry plugin if we have secrets

* Use env var for tag name

* Also spelling env correctly would likely help

* Fix variable syntax

* Put env var in correct place

One day maybe I will not find yaml syntax confusing
This commit is contained in:
David Baker 2023-01-03 10:48:48 +00:00 committed by GitHub
commit fef503c65d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 62 additions and 19 deletions

View file

@ -18,6 +18,11 @@ jobs:
run: "yarn install"
- name: Build
run: "yarn run build"
env:
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_URL: ${{ secrets.SENTRY_URL }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:

View file

@ -13,7 +13,7 @@ jobs:
name: Build & publish
runs-on: ubuntu-latest
permissions:
contents: read
contents: write # required to upload release asset
packages: write
steps:
- name: Check it out
@ -26,6 +26,33 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Yarn cache
uses: actions/setup-node@v3
with:
cache: "yarn"
- name: Install dependencies
run: "yarn install"
- name: Build
run: "yarn run build"
env:
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_URL: ${{ secrets.SENTRY_URL }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
VITE_APP_VERSION: ${{ github.event.release.tag_name }}
- name: Create Tarball
env:
GITHUB_TAG_NAME: ${{ github.event.release.tag_name }}
run: |
tar --numeric-owner --transform "s/dist/element-call-${GITHUB_TAG_NAME}/" -cvzf element-call-${GITHUB_TAG_NAME}.tar.gz dist
- name: Upload
uses: alexellis/upload-assets@0.4.0
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["element-call-${{ github.event.release.tag_name }}.tar.gz"]'
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38