-
Notifications
You must be signed in to change notification settings - Fork 8
83 lines (74 loc) · 2.56 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Release
on:
push:
branches:
- main
- release/*
- prerelease/*
permissions:
actions: write
contents: write
id-token: write
packages: write
pull-requests: write
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
outputs:
published: ${{ steps.changeset.outputs.published }}
publishedPackages: ${{ steps.changeset.outputs.publishedPackages }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly-2044faec64f99a21f0e5f0094458a973612d0712
- name: Install Dependencies
run: pnpm install
- name: Build
run: pnpm build
- name: Test
run: pnpm test
- name: "Report Coverage"
if: always()
uses: davelosert/vitest-coverage-report-action@v2
with:
working-directory: ./apps/cli
- name: Create Release Pull Request or Publish to npm
id: changeset
uses: changesets/action@v1
with:
commit: "release: version packages"
publish: pnpm run publish-packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
packages_to_build:
name: Get released packages
runs-on: ubuntu-latest
needs: release
if: ${{ needs.release.outputs.published == 'true' }}
outputs:
packages: ${{ steps.packages.outputs.PACKAGES }}
steps:
- name: Get released packages
id: packages
run: |
echo "PACKAGES=$(jq -c '[ .[].name ]' <(echo '${{ needs.release.outputs.publishedPackages }}'))" >> "$GITHUB_OUTPUT"
build_sdk:
name: Build sdk
needs: [release, packages_to_build]
if: ${{ needs.release.outputs.published == 'true' && contains(fromJSON(needs.packages_to_build.outputs.packages), '@cartesi/sdk') }}
uses: ./.github/workflows/sdk.yaml
secrets: inherit