Skip to content

Commit

Permalink
publish(ci): Add "Prepare Release" GHA and Artifacts upload (#23)
Browse files Browse the repository at this point in the history
Prepare our CI for publishing our packages by 

* adding the "Prepare Release" Github Action (analogously to
sentry-javascript or sentry-bundler-plugins)
* uploading build artifacts  to GH which craft pulls when publishing
  • Loading branch information
Lms24 committed Jan 23, 2023
1 parent d07d5e4 commit bb8c935
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 5 deletions.
41 changes: 36 additions & 5 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
name: Tests
name: Build & Tests

on: [pull_request]
on:
push:
branches:
- master
- release/**
pull_request:

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
job_test:
name: Tests
runs-on: ubuntu-latest
steps:
Expand All @@ -26,5 +31,31 @@ jobs:

- name: Run tests
# Skip this for now, as it somehow always fails
if: 1 == 2
run: xvfb-run --server-args="-screen 0 1920x1080x24" yarn test
if: 1 == 2
run: xvfb-run --server-args="-screen 0 1920x1080x24" yarn test

job_artifacts:
needs: job_test
name: Upload Artifacts
runs-on: ubuntu-latest
# Build artifacts are only needed for releasing workflow.
if: startsWith(github.ref, 'refs/heads/release/')
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Set up Node
uses: volta-cli/action@v3

- name: Install Dependencies
run: yarn --frozen-lockfile

- name: Build Tarballs
run: yarn build:tarball

- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ github.sha }}
path: |
${{ github.workspace }}/packages/**/*.tgz
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Prepare Release
on:
workflow_dispatch:
inputs:
version:
description: Version to release
required: true
force:
description: Force a release even when there are release-blockers (optional)
required: false
merge_target:
description: Target branch to merge into. Uses the default branch, sentry-v1, as a fallback (optional)
required: false
jobs:
release:
runs-on: ubuntu-latest
name: 'Release a new version'
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GH_RELEASE_PAT }}
fetch-depth: 0
- name: Prepare release
uses: getsentry/action-prepare-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
with:
version: ${{ github.event.inputs.version }}
force: ${{ github.event.inputs.force }}
merge_target: ${{ github.event.inputs.merge_target }}

0 comments on commit bb8c935

Please sign in to comment.