|
8 | 8 | name: Build and release
|
9 | 9 | runs-on: ubuntu-latest
|
10 | 10 | steps:
|
11 |
| - - uses: actions/checkout@v2 |
| 11 | + - name: Clone repository |
| 12 | + uses: actions/checkout@v4 |
12 | 13 | with:
|
13 | 14 | fetch-depth: 0 # fetch full history, so changelog can be generated
|
14 |
| - - uses: actions/setup-node@v2 |
| 15 | + |
| 16 | + - name: Setup Node |
| 17 | + uses: actions/setup-node@v4 |
| 18 | + with: |
| 19 | + node-version: '20' |
| 20 | + |
| 21 | + - name: Setup pnpm |
| 22 | + uses: pnpm/action-setup@v4 |
| 23 | + - name: Get pnpm store directory |
| 24 | + shell: bash |
| 25 | + run: | |
| 26 | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV |
| 27 | + - name: Setup pnpm cache |
| 28 | + uses: actions/cache@v4 |
15 | 29 | with:
|
16 |
| - node-version: '14' |
| 30 | + path: ${{ env.STORE_PATH }} |
| 31 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 32 | + restore-keys: | |
| 33 | + ${{ runner.os }}-pnpm-store- |
| 34 | +
|
| 35 | + - name: Install dependencies |
| 36 | + run: pnpm install --frozen-lockfile |
| 37 | + |
| 38 | + - name: Build |
| 39 | + run: pnpm build |
17 | 40 |
|
18 |
| - - run: yarn install --immutable |
| 41 | + - name: Lint |
| 42 | + run: pnpm lint |
19 | 43 |
|
20 |
| - - run: yarn run build |
| 44 | + - name: Unit tests |
| 45 | + run: pnpm test |
21 | 46 |
|
22 |
| - - run: yarn run lint |
23 |
| - - run: yarn run test |
24 |
| - - run: yarn run test-types |
| 47 | + - name: Types tests |
| 48 | + run: pnpm test-types |
25 | 49 |
|
26 |
| - - name: git config |
| 50 | + - name: Configure Git user |
27 | 51 | run: |
|
28 | 52 | git config user.name github-actions[bot]
|
29 | 53 | git config user.email 41898282+github-actions[bot]@users.noreply.github.com
|
30 | 54 |
|
31 |
| - - name: Create release |
| 55 | + - name: Create beta release |
32 | 56 | id: create_release
|
33 | 57 | run: |
|
34 |
| - yarn run release --prerelease beta |
| 58 | + pnpm release --prerelease beta |
35 | 59 | echo ::set-output name=tag_name::$(git describe HEAD --abbrev=0)
|
36 | 60 |
|
37 |
| - - name: copy README and LICENSE to packages |
| 61 | + - name: Copy README and LICENSE to packages |
38 | 62 | run: |
|
39 | 63 | cp README.md packages/aws-sdk-client-mock/README.md
|
40 | 64 | cp LICENSE packages/aws-sdk-client-mock/
|
41 | 65 | cp LICENSE packages/aws-sdk-client-mock-jest/
|
42 | 66 |
|
43 |
| - - name: run e2e tests |
| 67 | + - name: E2E tests |
44 | 68 | run: |
|
45 |
| - yarn run verdaccio & |
46 |
| - yarn run local-publish |
47 |
| - yarn run test-e2e |
| 69 | + pnpm verdaccio & |
| 70 | + pnpm local-publish |
| 71 | + pnpm test-e2e |
48 | 72 |
|
49 |
| - - run: yarn run publish --tag beta |
| 73 | + - name: Set publishing config |
| 74 | + run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}" |
50 | 75 | env:
|
51 |
| - YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 76 | + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |
| 77 | + - name: Publish beta to npm |
| 78 | + run: pnpm publish --tag beta |
52 | 79 |
|
53 | 80 | - uses: ad-m/github-push-action@master
|
54 | 81 | with:
|
55 | 82 | github_token: ${{ secrets.GITHUB_TOKEN }}
|
56 | 83 | tags: true
|
57 | 84 |
|
58 | 85 | - name: Generate Release body
|
59 |
| - run: npx extract-changelog-release > RELEASE_BODY.md |
| 86 | + run: pnpm extract-changelog-release > RELEASE_BODY.md |
60 | 87 |
|
61 | 88 | - name: Create GitHub Release
|
62 |
| - uses: softprops/action-gh-release@v1 |
| 89 | + uses: softprops/action-gh-release@v2 |
63 | 90 | with:
|
64 | 91 | token: ${{ secrets.GITHUB_TOKEN }}
|
65 | 92 | tag_name: ${{ steps.create_release.outputs.tag_name }}
|
|
0 commit comments