|
4 | 4 | push: |
5 | 5 | branches: |
6 | 6 | - main |
| 7 | + - develop |
| 8 | + |
| 9 | +permissions: |
| 10 | + id-token: write # for OIDC / npm provenance if you use it |
| 11 | + actions: write # if you dispatch other workflows |
| 12 | + contents: write # commits / tags / merge-back |
7 | 13 |
|
8 | 14 | jobs: |
9 | | - publish-release: |
| 15 | + publish: |
10 | 16 | runs-on: ubuntu-latest |
11 | 17 | strategy: |
12 | 18 | matrix: |
13 | | - node-version: [22.x] |
| 19 | + node-version: [24.x] |
| 20 | + |
14 | 21 | steps: |
15 | 22 | - uses: actions/checkout@v2 |
16 | 23 | with: |
17 | | - # pulls all commits (needed for semantic release to correctly version) |
18 | | - fetch-depth: '0' |
19 | | - # pulls all tags (needed for semantic release to correctly version) |
20 | | - - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* |
| 24 | + fetch-depth: "0" |
| 25 | + |
| 26 | + - name: Fetch tags |
| 27 | + run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* |
| 28 | + |
21 | 29 | - name: Use Node.js ${{ matrix.node-version }} |
22 | 30 | uses: actions/setup-node@v4 |
23 | 31 | with: |
24 | 32 | node-version: ${{ matrix.node-version }} |
25 | | - registry-url: 'https://registry.npmjs.org' |
| 33 | + registry-url: "https://registry.npmjs.org" |
| 34 | + |
26 | 35 | - name: Prepare git |
27 | 36 | run: | |
28 | | - git config --global user.name 'stream-ci-bot' |
| 37 | + git config --global user.name 'stream-ci-bot' |
29 | 38 | git config --global user.email '[email protected]' |
| 39 | +
|
30 | 40 | - name: Install && Build - SDK and Sample App |
31 | 41 | uses: ./.github/actions/install-and-build-sdk |
| 42 | + |
32 | 43 | - name: Lint |
33 | 44 | run: yarn lerna-workspaces run lint |
34 | | - - name: Publish Release |
| 45 | + |
| 46 | + - name: Test |
| 47 | + if: github.ref == 'refs/heads/develop' |
| 48 | + run: yarn test:coverage |
| 49 | + |
| 50 | + - name: Publish Next Release (develop) |
| 51 | + if: github.ref == 'refs/heads/develop' |
| 52 | + run: | |
| 53 | + GITHUB_SHORT_SHA="$(git rev-parse --short $GITHUB_SHA)" yarn release-next |
| 54 | +
|
| 55 | + - name: Publish Release (main) |
| 56 | + if: github.ref == 'refs/heads/main' |
35 | 57 | run: yarn release |
36 | | - env: |
37 | | - NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} |
38 | | - - name: Merge back changes |
| 58 | + |
| 59 | + - name: Merge back changes (main -> develop) |
| 60 | + if: github.ref == 'refs/heads/main' |
39 | 61 | run: | |
40 | 62 | git stash |
41 | 63 | git checkout develop |
|
0 commit comments