|
|
@@ -0,0 +1,71 @@
|
|
|
+name: Main
|
|
|
+
|
|
|
+on:
|
|
|
+ push:
|
|
|
+ branches: [main]
|
|
|
+ pull_request:
|
|
|
+ branches: [main]
|
|
|
+
|
|
|
+jobs:
|
|
|
+ lint:
|
|
|
+ name: Check styling
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+ steps:
|
|
|
+ - uses: actions/checkout@v3
|
|
|
+ - uses: pnpm/action-setup@v2
|
|
|
+ - uses: actions/setup-node@v3
|
|
|
+ with:
|
|
|
+ node-version: 18
|
|
|
+ cache: "pnpm"
|
|
|
+ - name: Install dependencies
|
|
|
+ run: pnpm install --frozen-lockfile
|
|
|
+ - name: Check linting
|
|
|
+ run: pnpm run lint
|
|
|
+
|
|
|
+ tests:
|
|
|
+ name: Test
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+ strategy:
|
|
|
+ matrix:
|
|
|
+ solana: ["1.17", "1.18"]
|
|
|
+
|
|
|
+ steps:
|
|
|
+ - uses: actions/checkout@v3
|
|
|
+ - uses: pnpm/action-setup@v2
|
|
|
+ - uses: actions/setup-node@v3
|
|
|
+ with:
|
|
|
+ node-version: 18
|
|
|
+ cache: "pnpm"
|
|
|
+ - uses: metaplex-foundation/actions/install-solana@v1
|
|
|
+ with:
|
|
|
+ version: ${{ matrix.solana }}
|
|
|
+ - name: Install dependencies
|
|
|
+ run: pnpm install --frozen-lockfile
|
|
|
+ - name: Build and run tests
|
|
|
+ run: pnpm test
|
|
|
+
|
|
|
+ release:
|
|
|
+ name: Release
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+ if: github.event_name == 'push'
|
|
|
+ needs: [lint, tests]
|
|
|
+ outputs:
|
|
|
+ published: ${{ steps.changesets.outputs.published }}
|
|
|
+ steps:
|
|
|
+ - uses: actions/checkout@v3
|
|
|
+ - uses: pnpm/action-setup@v2
|
|
|
+ - uses: actions/setup-node@v3
|
|
|
+ with:
|
|
|
+ node-version: 18
|
|
|
+ cache: "pnpm"
|
|
|
+ - name: Install Dependencies
|
|
|
+ run: pnpm install --frozen-lockfile
|
|
|
+ - name: Create Release Pull Request or Publish
|
|
|
+ id: changesets
|
|
|
+ uses: changesets/action@v1
|
|
|
+ with:
|
|
|
+ commit: "Release packages"
|
|
|
+ title: "Release packages"
|
|
|
+ env:
|
|
|
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|