Merge pull request #17 from monerium/release-please--branches--main #23
This file contains 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: CI | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
types: [opened, synchronize] | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
outputs: | |
data: ${{ toJson(steps.rp.outputs) }} | |
steps: | |
- uses: googleapis/release-please-action@v4 | |
id: rp | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
release-values: | |
name: "Release values" | |
needs: [release-please] | |
runs-on: ubuntu-latest | |
steps: | |
- name: echo outputs | |
run: | | |
echo "Release created: ${{ needs.release-please.outputs.data.release_created }}" | |
echo "Releases created: ${{ needs.release-please.outputs.data.releases_created }}" | |
echo "Release sha: ${{ needs.release-please.outputs.data.sha }}" | |
build: | |
needs: [release-please] | |
name: Build and Test | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Cache turbo build setup | |
uses: actions/cache@v4 | |
with: | |
path: .turbo | |
key: ${{ runner.os }}-turbo-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-turbo- | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 8 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "pnpm" | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build | |
run: pnpm build | |
- name: Test | |
run: pnpm test | |
- name: PrePublish SDK | |
run: pnpm --filter @monerium/sdk pub:pre | |
if: ${{ needs.release-please.outputs.data['packages/sdk--release_created'] }} | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
- name: PrePublish React Provider | |
run: pnpm --filter @monerium/sdk-react-provider pub:pre | |
if: ${{ needs.release-please.outputs.data['packages/sdk-react-provider--release_created'] }} | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |