Skip to content

fix: Update GitHub Actions release workflow permissions: #3

fix: Update GitHub Actions release workflow permissions:

fix: Update GitHub Actions release workflow permissions: #3

Workflow file for this run

name: Release & Publish
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: write
issues: write
pull-requests: write
packages: write
jobs:
release:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Install dependencies and build
run: |
# Install semantic-release and plugins
npm install -g semantic-release @semantic-release/changelog @semantic-release/git @semantic-release/exec @semantic-release/npm
# Install Python build tools
python -m pip install --upgrade pip build twine
# Install workspace dependencies (includes TypeScript SDK)
npm ci
- name: Build and test TypeScript SDK
run: |
npm run build --workspace=sdk/typescript
npm run test --workspace=sdk/typescript
- name: Build and test Python SDK
run: |
cd sdk/python
pip install -e .
python -m pytest || echo "Python tests not yet implemented"
- name: Build and test contracts
run: |
cd contracts
npm install
npm run build
npm test
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release