Skip to content

Merge pull request #126 from paritytech/dependabot/cargo/e2e/cli/fixt… #88

Merge pull request #126 from paritytech/dependabot/cargo/e2e/cli/fixt…

Merge pull request #126 from paritytech/dependabot/cargo/e2e/cli/fixt… #88

Workflow file for this run

name: Release
on:
push:
branches: [main]
permissions:
contents: write
jobs:
release:
if: github.actor != 'github-actions[bot]'
runs-on: ${{ github.repository_owner == 'paritytech' && 'parity-default' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for changesets
id: changesets
run: |
if ls .changeset/*.md 2>/dev/null | grep -qv README.md; then
echo "found=true" >> $GITHUB_OUTPUT
else
echo "found=false" >> $GITHUB_OUTPUT
fi
- if: steps.changesets.outputs.found == 'true'
uses: oven-sh/setup-bun@v2
with:
bun-version: "1.2.x"
- if: steps.changesets.outputs.found == 'true'
uses: pnpm/action-setup@v4
- if: steps.changesets.outputs.found == 'true'
uses: actions/setup-node@v4
with:
node-version: "22"
- if: steps.changesets.outputs.found == 'true'
run: pnpm install
- name: Version packages
if: steps.changesets.outputs.found == 'true'
run: pnpm changeset version
- name: Format
if: steps.changesets.outputs.found == 'true'
run: pnpm format
- name: Commit version changes
if: steps.changesets.outputs.found == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git diff --cached --quiet || git commit -m "chore: version packages"
git push
- name: Compile CLI binaries
if: steps.changesets.outputs.found == 'true'
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: Generate release tag
if: steps.changesets.outputs.found == 'true'
id: tag
run: |
VERSION=$(node -p "require('./package.json').version")
TAG="v${VERSION}"
echo "tag=$TAG" >> $GITHUB_OUTPUT
- name: Create GitHub Release
if: steps.changesets.outputs.found == 'true'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag.outputs.tag }}
name: Release ${{ steps.tag.outputs.tag }}
files: |
dot-linux-x64
dot-linux-arm64
dot-darwin-x64
dot-darwin-arm64
generate_release_notes: true