Skip to content

v0.1.8 (#283)

v0.1.8 (#283) #89

Workflow file for this run

name: Publish sdk-dapp-ui
on:
push:
branches: [main]
repository_dispatch:
types: publish-npm
workflow_dispatch:
permissions:
contents: write
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
clean: true
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: 'https://registry.npmjs.org'
- name: Setup pnpm
run: npm install -g pnpm
- name: Install Chrome for Puppeteer
run: |
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install -y google-chrome-stable
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Run unit tests
run: pnpm run test
env:
PUPPETEER_EXECUTABLE_PATH: /usr/bin/google-chrome-stable
- name: Clear dist
run: rm -rf dist
- name: Build
run: pnpm run build
- name: Get package info
id: package
uses: andreigiura/[email protected]
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ steps.package.outputs.is-prerelease == 'false' }}
run: |
RELEASE_TAG=v$(node -p "require('./package.json').version")
echo "Creating release for version: $RELEASE_TAG"
changelog_content=$(awk "/^## \[\[?${RELEASE_TAG#v}[^\]]*\]/{flag=1; next} /^## \[/{flag=0} flag" CHANGELOG.md)
cat > release_notes.md << EOF
## What's Changed
$changelog_content
EOF
# Create the release
gh release create "$RELEASE_TAG" \
--target=$GITHUB_SHA \
--title="$RELEASE_TAG" \
--notes-file release_notes.md
- name: Publish to npmjs next version
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ steps.package.outputs.is-prerelease == 'true'}}
run: echo ${{ steps.package.outputs.is-prerelease}} && npm publish --tag next
- name: Publish to npmjs
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ steps.package.outputs.is-prerelease == 'false' }}
run: npm publish