Skip to content

meta(changelog): Update package versions (#523) #124

meta(changelog): Update package versions (#523)

meta(changelog): Update package versions (#523) #124

Workflow file for this run

name: Publish
on:
push:
branches:
- main
paths:
- '**/CHANGELOG.md'
workflow_dispatch:
inputs:
nocache:
description: 'Do not rely on existing Docker layer cache'
default: false
type: boolean
docker:
description: 'Publish Docker package'
default: true
type: boolean
npm:
description: 'Publish NPM package (immutable)'
default: true
type: boolean
electron:
description: 'Publish Electron package'
default: true
type: boolean
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
npm:
name: NPM Package
runs-on: ubuntu-latest
# For whatever reason, yaml does not like the full "meta(changelog): Update package versions" string
# So we check this in two parts
if: |
(contains(github.event.head_commit.message, 'meta(changelog)')
&& contains(github.event.head_commit.message, 'Update package versions'))
|| inputs.npm
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
- name: Setup pnpm & install dependencies
uses: pnpm/action-setup@v4
with:
run_install: true
- name: Publish to NPM
uses: changesets/action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
with:
publish: pnpm changeset:publish
createGithubReleases: true
docker:
name: Docker Image
needs: npm
runs-on: ubuntu-latest
if: |
!cancelled()
&& (inputs.docker || github.event_name == 'push')
&& (needs.npm.result == 'success' || needs.npm.result == 'skipped')
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: .
cache-from: type=gha,scope=prod
no-cache: ${{ inputs.nocache == true }}
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/getsentry/spotlight:latest
ghcr.io/getsentry/spotlight:${{ github.sha }}
- name: Summarize
run: |
echo "**Tag:** ``ghcr.io/getsentry/spotlight:${{ github.sha }}``" >> $GITHUB_STEP_SUMMARY
electron:
name: Electron Build
needs: npm
runs-on: macos-latest
if: |
!cancelled()
&& (inputs.electron || github.event_name == 'push')
&& (needs.npm.result == 'success' || needs.npm.result == 'skipped')
# strategy:
# fail-fast: false
# matrix:
# platform: [x64, arm64]
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
- name: Setup pnpm & install dependencies
uses: pnpm/action-setup@v4
with:
run_install: true
- name: Build Electron
env:
APPLEID: ${{ secrets.APPLEID }}
APPLEIDPASS: ${{ secrets.APPLEIDPASS }}
TEAMID: ${{ secrets.TEAMID }}
CERT_PASS: ${{ secrets.CERT_PASS }}
MAIN_VITE_SENTRY_ORG: ${{ secrets.MAIN_VITE_SENTRY_ORG }}
MAIN_VITE_SENTRY_PROJECT: ${{ secrets.MAIN_VITE_SENTRY_PROJECT }}
MAIN_VITE_SENTRY_AUTH_TOKEN: ${{ secrets.MAIN_VITE_SENTRY_AUTH_TOKEN }}
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
run: cd packages/electron && pnpm build:mac
- name: Gets latest created release info
id: latest_release_info
uses: gregziegan/fetch-latest-release@v2.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: packages/electron/dist/*.zip
tag: ${{ steps.latest_release_info.outputs.tag_name }}
file_glob: true
make_latest: false