Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/preview-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release Branch

on:
workflow_dispatch:

permissions: {}

jobs:
release:
timeout-minutes: 20
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/ci-setup

- run: yarn changeset version --snapshot branch-${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build
run: yarn build

- name: Setup Git user
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"

- name: Release snapshot version
run: yarn run release:pr
env:
GITHUB_REF_NAME: ${{ github.ref_name }}

- name: Summarize preview release
run: |
commit_sha=$(git rev-parse HEAD)
repository_owner="${{ github.repository_owner }}"
repository_name="${{ github.event.repository.name }}"

{
echo "See the diff for this built version: https://github.com/changesets/action/compare/main...${repository_owner}:${repository_name}:${commit_sha}"
echo ""
echo "Use this preview build in a GitHub Actions workflow:"
echo ""
echo '```yaml'
echo " - uses: ${GITHUB_REPOSITORY}@${commit_sha}"
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
183 changes: 0 additions & 183 deletions .github/workflows/release-pr.yml

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/release-pr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import path from "node:path";
import pkgJson from "../package.json" with { type: "json" };

const tag = `v${pkgJson.version}`;
const releaseLine = "pr-release";
const releaseLine = `built-${process.env.GITHUB_REF_NAME}`;

process.chdir(path.join(import.meta.dirname, ".."));

Expand Down