--------- Co-authored-by: DavidMaliglowka <13022280+DavidMaliglowka@users.noreply.github.com> Co-authored-by: Ralph Khreish <35776126+Crunchyman-ralph@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
69 lines
1.8 KiB
YAML
69 lines
1.8 KiB
YAML
name: Release
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
id-token: write
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: 'npm'
|
|
|
|
- name: Cache node_modules
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
node_modules
|
|
*/*/node_modules
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-node-
|
|
|
|
- name: Install Dependencies
|
|
run: npm ci
|
|
timeout-minutes: 2
|
|
|
|
- name: Exit pre-release mode and clean up
|
|
run: |
|
|
echo "🔄 Ensuring we're not in pre-release mode for main branch..."
|
|
|
|
# Exit pre-release mode if we're in it
|
|
npx changeset pre exit || echo "Not in pre-release mode"
|
|
|
|
# Remove pre.json file if it exists (belt and suspenders approach)
|
|
if [ -f .changeset/pre.json ]; then
|
|
echo "🧹 Removing pre.json file..."
|
|
rm -f .changeset/pre.json
|
|
fi
|
|
|
|
# Verify the file is gone
|
|
if [ ! -f .changeset/pre.json ]; then
|
|
echo "✅ pre.json successfully removed"
|
|
else
|
|
echo "❌ Failed to remove pre.json"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Create Release Pull Request or Publish to npm
|
|
uses: changesets/action@v1
|
|
with:
|
|
publish: ./.github/scripts/release.sh
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|