diff --git a/.craft.yml b/.craft.yml new file mode 100644 index 00000000..56e26bd0 --- /dev/null +++ b/.craft.yml @@ -0,0 +1,17 @@ +github: + owner: getsentry + repo: bundler-plugins +changelogPolicy: simple +preReleaseCommand: bash scripts/craft-pre-release.sh +requireNames: + - /^sentry-bundler-plugin-core--*.tgz$/ + - /^sentry-esbuild-plugin-*.tgz$/ + - /^sentry-rollup-plugin-*.tgz$/ + - /^sentry-vite-plugin-*.tgz$/ + # TODO: Comment in when we replace the webpack plugin + # - /^sentry-webpack-plugin-*.tgz$/ +targets: + - name: github + includeNames: /^sentry-.*.tgz$/ + - name: npm + includeNames: /^sentry-.*.tgz$/ diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index e71cd7a4..dee7a2c2 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@v3 + with: + name: ${{ github.sha }} + path: | + ${{ github.workspace }}/packages/*/dist/** + ${{ github.workspace }}/packages/**/*.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 }}