Skip to content

Commit 6977e41

Browse files
authored
feat(publish): Add GHA and Craft configs (#55)
This adds a few files to set up Craft and our release process. - New GHA `release` workflow - Upload artifacts job - Craft config
1 parent a8975d6 commit 6977e41

File tree

3 files changed

+84
-1
lines changed

3 files changed

+84
-1
lines changed

.craft.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
github:
2+
owner: getsentry
3+
repo: bundler-plugins
4+
changelogPolicy: simple
5+
preReleaseCommand: bash scripts/craft-pre-release.sh
6+
requireNames:
7+
- /^sentry-bundler-plugin-core--*.tgz$/
8+
- /^sentry-esbuild-plugin-*.tgz$/
9+
- /^sentry-rollup-plugin-*.tgz$/
10+
- /^sentry-vite-plugin-*.tgz$/
11+
# TODO: Comment in when we replace the webpack plugin
12+
# - /^sentry-webpack-plugin-*.tgz$/
13+
targets:
14+
- name: github
15+
includeNames: /^sentry-.*.tgz$/
16+
- name: npm
17+
includeNames: /^sentry-.*.tgz$/

.github/workflows/checks.yml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ name: Checks
22

33
on:
44
push:
5-
branches: [main]
5+
branches:
6+
- main
7+
- release/**
68
pull_request:
79

810
env:
11+
# We pin the exact version to enforce reproducable builds with node + npm.
912
DEFAULT_NODE_VERSION: "16.15.1"
1013

1114
jobs:
@@ -66,3 +69,36 @@ jobs:
6669
node-version: ${{ env.DEFAULT_NODE_VERSION }}
6770
- run: yarn --frozen-lockfile
6871
- run: yarn lint
72+
73+
artifacts:
74+
needs: build
75+
name: Upload Artifacts
76+
runs-on: ubuntu-latest
77+
# Build artifacts are only needed for releasing workflow.
78+
# TODO comment back in
79+
# if: startsWith(github.ref, 'refs/heads/release/')
80+
steps:
81+
- uses: actions/checkout@v3
82+
- uses: actions/setup-node@v3
83+
with:
84+
node-version: ${{ env.DEFAULT_NODE_VERSION }}
85+
# - name: Check dependency cache
86+
# uses: actions/cache@v3
87+
# with:
88+
# path: ${{ env.CACHED_DEPENDENCY_PATHS }}
89+
# key: ${{ needs.job_build.outputs.dependency_cache_key }}
90+
# - name: Check build cache
91+
# uses: actions/cache@v3
92+
# with:
93+
# path: ${{ env.CACHED_BUILD_PATHS }}
94+
# key: ${{ env.BUILD_CACHE_KEY }}
95+
- run: yarn --frozen-lockfile
96+
- name: pack
97+
run: yarn build:npm
98+
- name: archive artifacts
99+
uses: actions/upload-artifact@v3
100+
with:
101+
name: ${{ github.sha }}
102+
path: |
103+
${{ github.workspace }}/packages/*/dist/**
104+
${{ 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 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)