Skip to content

Merge pull request #2188 from evidence-dev/changeset-release/main #707

Merge pull request #2188 from evidence-dev/changeset-release/main

Merge pull request #2188 from evidence-dev/changeset-release/main #707

Workflow file for this run

name: Release
on:
push:
branches:
- main
jobs:
release:
# prevents this action from running on forks
if: github.repository == 'evidence-dev/evidence'
name: Release
runs-on: ubuntu-latest
outputs:
published: ${{ steps.changesets.outputs.published }}
publishedPackages: ${{ steps.changesets.outputs.publishedPackages }}
steps:
- name: Checkout Repo
uses: actions/checkout@v2
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- uses: pnpm/[email protected]
with:
version: 8.6.9
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: pnpm
- run: pnpm install --frozen-lockfile
# - run: pnpm build
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
trigger-e2e-smoke-tests:
runs-on: ubuntu-latest
needs: release
if: (needs.release.outputs.published == true || needs.release.outputs.published == 'true')
steps:
- run: echo ${{needs.release.outputs.published}} ${{needs.release.outputs.publishedPackages}}
- name: Repository Dispatch to trigger E2E smoke tests
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.E2E_SMOKE_TESTS_REPO_ACCESS_PAT }}
repository: evidence-dev/e2e-smoke-tests
event-type: evidence-release
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "source":"evidence-dev/evidence", "published": "${{ needs.release.outputs.published }}", "publishedPackages": ${{ needs.release.outputs.publishedPackages }}}'