Skip to content
Merged
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
50 changes: 17 additions & 33 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ on:
- "crates/**"
- "packages/**"
- ".github/workflows/releases.yml"
pull_request:
branches: [main]

jobs:
release-rust:
Expand All @@ -33,40 +35,20 @@ jobs:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

Comment thread
coderabbitai[bot] marked this conversation as resolved.
- name: Clean working directory
run: |
# Show current git status for debugging
echo "Git status before cleaning:"
git status --porcelain || true

# Ensure we're on the main branch and up to date
git checkout main
git pull origin main

# Stash any local changes
git stash --include-untracked || true

# Remove any generated artifacts that might interfere with release-plz
git clean -fd
git reset --hard HEAD

# Force remove the entire artifacts directory (it should be regenerated by .gitignore rules)
rm -rf packages/enclave-contracts/artifacts/ || true
rm -rf packages/enclave-contracts/cache/ || true
rm -rf packages/enclave-contracts/types/ || true
rm -rf packages/enclave-contracts/node_modules/ || true
rm -rf packages/enclave-contracts/dist/ || true

# Also clean up any Rust build artifacts
rm -rf target/ || true
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

# Final reset to ensure everything is clean
git reset --hard HEAD
git clean -fd
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 10.7.1

# Verify working directory is clean
echo "Git status after cleaning:"
git status --porcelain
- name: Install dependencies
run: |
cd packages/enclave-contracts
pnpm install --frozen-lockfile

- name: Run release-plz
id: release-plz
Expand All @@ -76,6 +58,7 @@ jobs:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
with:
version: "0.3.83"
command: ${{ github.event_name == 'pull_request' && 'release-pr --dry-run' || 'release-pr' }}

- uses: fregante/setup-git-user@v2.0.1
if: steps.release-plz.outputs.prs_created == 'true'
Expand All @@ -98,6 +81,7 @@ jobs:
name: Release NPM Packages
runs-on: ubuntu-latest
needs: release-rust
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -132,7 +116,7 @@ jobs:
name: Trigger Binary Release
runs-on: ubuntu-latest
needs: [release-rust, release-npm]
if: needs.release-rust.outputs.releases_created == 'true'
if: github.event_name == 'push' && needs.release-rust.outputs.releases_created == 'true'
steps:
- uses: actions/checkout@v4

Expand Down
Loading
Loading