From cb4427158e55973c66164d79f38b6fe86e20218f Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Thu, 20 Oct 2022 11:08:44 +0200 Subject: [PATCH 1/4] feat(publish): Add Craft config --- .craft.yml | 16 ++++++++++++++++ .github/workflows/release.yml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .craft.yml create mode 100644 .github/workflows/release.yml diff --git a/.craft.yml b/.craft.yml new file mode 100644 index 00000000..1d2c62db --- /dev/null +++ b/.craft.yml @@ -0,0 +1,16 @@ +github: + owner: getsentry + repo: sentry-unplugin +changelogPolicy: simple +preReleaseCommand: bash scripts/craft-pre-release.sh +requireNames: + - /^sentry-sentry-unplugin-*.tgz$/ + - /^sentry-esbuild-plugin-*.tgz$/ + - /^sentry-rollup-plugin-*.tgz$/ + - /^sentry-vite-plugin-*.tgz$/ + - /^sentry-sentry-webpack-plugin-*.tgz$/ +targets: + - name: github + includeNames: /^sentry-.*.tgz$/ + - name: npm + includeNames: /^sentry-.*.tgz$/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..15eea425 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 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 }} From 8a1e218d397d220afd7cd76690d39405811bc0b6 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Thu, 20 Oct 2022 13:45:48 +0200 Subject: [PATCH 2/4] exclude webpack plugin, rename after repo change --- .craft.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.craft.yml b/.craft.yml index 1d2c62db..096985cd 100644 --- a/.craft.yml +++ b/.craft.yml @@ -1,16 +1,21 @@ github: owner: getsentry - repo: sentry-unplugin + repo: bundler-plugins changelogPolicy: simple preReleaseCommand: bash scripts/craft-pre-release.sh requireNames: - - /^sentry-sentry-unplugin-*.tgz$/ + - /^sentry-bundler-plugin-core--*.tgz$/ - /^sentry-esbuild-plugin-*.tgz$/ - /^sentry-rollup-plugin-*.tgz$/ - /^sentry-vite-plugin-*.tgz$/ - - /^sentry-sentry-webpack-plugin-*.tgz$/ + # TODO: Comment in when we replace the webpack plugin + # - /^sentry-webpack-plugin-*.tgz$/ targets: - name: github includeNames: /^sentry-.*.tgz$/ + # TODO: Remove once we replace the webpack plugin + excludeNames: /^sentry-webpack-plugin-*.tgz$/ - name: npm includeNames: /^sentry-.*.tgz$/ + # TODO: Remove once we replace the webpack plugin + excludeNames: /^sentry-webpack-plugin-*.tgz$/ From 80bf1bc3b557b9638cbf2396eaa8d2ec4dc8c887 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Thu, 20 Oct 2022 14:23:49 +0200 Subject: [PATCH 3/4] add upload artifacts job --- .github/workflows/checks.yml | 38 +++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index e71cd7a4..d6a068ab 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -2,10 +2,13 @@ name: Checks on: push: - branches: [main] + branches: + - main + - release/** pull_request: env: + # We pin the exact version to enforce reproducable builds with node + npm. DEFAULT_NODE_VERSION: "16.15.1" jobs: @@ -66,3 +69,36 @@ jobs: node-version: ${{ env.DEFAULT_NODE_VERSION }} - run: yarn --frozen-lockfile - run: yarn lint + + artifacts: + needs: build + name: Upload Artifacts + runs-on: ubuntu-latest + # Build artifacts are only needed for releasing workflow. + # TODO comment back in + # if: startsWith(github.ref, 'refs/heads/release/') + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: ${{ env.DEFAULT_NODE_VERSION }} + # - name: Check dependency cache + # uses: actions/cache@v3 + # with: + # path: ${{ env.CACHED_DEPENDENCY_PATHS }} + # key: ${{ needs.job_build.outputs.dependency_cache_key }} + # - name: Check build cache + # uses: actions/cache@v3 + # with: + # path: ${{ env.CACHED_BUILD_PATHS }} + # key: ${{ env.BUILD_CACHE_KEY }} + - run: yarn --frozen-lockfile + - name: pack + run: yarn build:npm + - name: archive artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ github.sha }} + path: | + ${{ github.workspace }}/packages/*/dist/** + ${{ github.workspace }}/packages/**/*.tgz From 52ea99350cf1cddc7445c5d5a58e0de19cf2d3ea Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Thu, 20 Oct 2022 14:49:58 +0200 Subject: [PATCH 4/4] simplify craft cfg --- .craft.yml | 4 ---- .github/workflows/checks.yml | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.craft.yml b/.craft.yml index 096985cd..56e26bd0 100644 --- a/.craft.yml +++ b/.craft.yml @@ -13,9 +13,5 @@ requireNames: targets: - name: github includeNames: /^sentry-.*.tgz$/ - # TODO: Remove once we replace the webpack plugin - excludeNames: /^sentry-webpack-plugin-*.tgz$/ - name: npm includeNames: /^sentry-.*.tgz$/ - # TODO: Remove once we replace the webpack plugin - excludeNames: /^sentry-webpack-plugin-*.tgz$/ diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index d6a068ab..dee7a2c2 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -96,7 +96,7 @@ jobs: - name: pack run: yarn build:npm - name: archive artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: ${{ github.sha }} path: |