Skip to content

Commit bb8c935

Browse files
committed
publish(ci): Add "Prepare Release" GHA and Artifacts upload (#23)
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
1 parent d07d5e4 commit bb8c935

File tree

2 files changed

+66
-5
lines changed

2 files changed

+66
-5
lines changed

.github/workflows/ci-cd.yml

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
name: Tests
1+
name: Build & Tests
22

3-
on: [pull_request]
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- release/**
8+
pull_request:
49

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

712
jobs:
8-
release:
13+
job_test:
914
name: Tests
1015
runs-on: ubuntu-latest
1116
steps:
@@ -26,5 +31,31 @@ jobs:
2631

2732
- name: Run tests
2833
# Skip this for now, as it somehow always fails
29-
if: 1 == 2
30-
run: xvfb-run --server-args="-screen 0 1920x1080x24" yarn test
34+
if: 1 == 2
35+
run: xvfb-run --server-args="-screen 0 1920x1080x24" yarn test
36+
37+
job_artifacts:
38+
needs: job_test
39+
name: Upload Artifacts
40+
runs-on: ubuntu-latest
41+
# Build artifacts are only needed for releasing workflow.
42+
if: startsWith(github.ref, 'refs/heads/release/')
43+
steps:
44+
- name: Checkout Repo
45+
uses: actions/checkout@v3
46+
47+
- name: Set up Node
48+
uses: volta-cli/action@v3
49+
50+
- name: Install Dependencies
51+
run: yarn --frozen-lockfile
52+
53+
- name: Build Tarballs
54+
run: yarn build:tarball
55+
56+
- name: Upload Artifacts
57+
uses: actions/upload-artifact@v3
58+
with:
59+
name: ${{ github.sha }}
60+
path: |
61+
${{ github.workspace }}/packages/**/*.tgz

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Prepare Release
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: Version to release
7+
required: true
8+
force:
9+
description: Force a release even when there are release-blockers (optional)
10+
required: false
11+
merge_target:
12+
description: Target branch to merge into. Uses the default branch, sentry-v1, as a fallback (optional)
13+
required: false
14+
jobs:
15+
release:
16+
runs-on: ubuntu-latest
17+
name: 'Release a new version'
18+
steps:
19+
- uses: actions/checkout@v3
20+
with:
21+
token: ${{ secrets.GH_RELEASE_PAT }}
22+
fetch-depth: 0
23+
- name: Prepare release
24+
uses: getsentry/action-prepare-release@v1
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
27+
with:
28+
version: ${{ github.event.inputs.version }}
29+
force: ${{ github.event.inputs.force }}
30+
merge_target: ${{ github.event.inputs.merge_target }}

0 commit comments

Comments
 (0)