Add contracts to build & deploy commands
#40
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Dev Release | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: "1.2.x" | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| - run: pnpm install | |
| - name: Compile CLI binaries | |
| run: | | |
| bun build --compile --target=bun-linux-x64 src/index.ts --outfile dot-linux-x64 | |
| bun build --compile --target=bun-linux-arm64 src/index.ts --outfile dot-linux-arm64 | |
| bun build --compile --target=bun-darwin-x64 src/index.ts --outfile dot-darwin-x64 | |
| bun build --compile --target=bun-darwin-arm64 src/index.ts --outfile dot-darwin-arm64 | |
| - name: Delete previous dev release | |
| run: gh release delete "dev/${{ github.head_ref }}" --cleanup-tag -y 2>/dev/null || true | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - name: Create dev release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: dev/${{ github.head_ref }} | |
| name: "Dev: ${{ github.head_ref }}" | |
| prerelease: true | |
| make_latest: false | |
| files: | | |
| dot-linux-x64 | |
| dot-linux-arm64 | |
| dot-darwin-x64 | |
| dot-darwin-arm64 | |
| body: | | |
| Dev build from `${{ github.head_ref }}`. | |
| ``` | |
| curl -fsSL https://raw.githubusercontent.com/paritytech/playground-cli/main/install.sh | VERSION=dev/${{ github.head_ref }} bash | |
| ``` | |
| - name: Comment install command on PR | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| PR: ${{ github.event.pull_request.number }} | |
| BRANCH: ${{ github.head_ref }} | |
| run: | | |
| MARKER="<!-- dev-release -->" | |
| BODY="${MARKER} | |
| **Dev build ready** — try this branch: | |
| \`\`\` | |
| curl -fsSL https://raw.githubusercontent.com/paritytech/playground-cli/main/install.sh | VERSION=dev/${BRANCH} bash | |
| \`\`\`" | |
| # Find existing comment by marker, update or create | |
| COMMENT_ID=$(gh api repos/${{ github.repository }}/issues/${PR}/comments --jq ".[] | select(.body | startswith(\"${MARKER}\")) | .id" | head -1) | |
| if [ -n "$COMMENT_ID" ]; then | |
| gh api repos/${{ github.repository }}/issues/comments/${COMMENT_ID} -X PATCH -f body="$BODY" | |
| else | |
| gh pr comment "$PR" --body "$BODY" | |
| fi |