|
1 | | -name: "@smakss/react-scroll-direction" |
| 1 | +name: Release |
2 | 2 |
|
3 | 3 | on: |
4 | | - release: |
5 | | - types: [created] |
| 4 | + push: |
| 5 | + branches: [master] |
6 | 6 |
|
7 | 7 | jobs: |
8 | | - build: |
9 | | - runs-on: ubuntu-latest |
10 | | - steps: |
11 | | - - uses: actions/checkout@v4 |
12 | | - - uses: pnpm/action-setup@v4 |
13 | | - with: |
14 | | - version: 10 |
15 | | - - uses: actions/setup-node@v4 |
16 | | - with: |
17 | | - node-version: 20 |
18 | | - cache: pnpm |
19 | | - - run: pnpm install --frozen-lockfile |
20 | | - - run: pnpm generate |
21 | | - - uses: actions/upload-artifact@v4 |
22 | | - with: |
23 | | - name: built-package |
24 | | - path: | |
25 | | - ./dist |
26 | | - package.json |
27 | | -
|
28 | | - publish-npm: |
29 | | - needs: build |
| 8 | + release: |
30 | 9 | runs-on: ubuntu-latest |
| 10 | + permissions: |
| 11 | + contents: write |
| 12 | + issues: write |
| 13 | + pull-requests: write |
31 | 14 | steps: |
32 | 15 | - uses: actions/checkout@v4 |
33 | | - - uses: actions/download-artifact@v4 |
34 | 16 | with: |
35 | | - name: built-package |
| 17 | + fetch-depth: 0 |
36 | 18 | - uses: pnpm/action-setup@v4 |
37 | 19 | with: |
38 | 20 | version: 10 |
39 | 21 | - uses: actions/setup-node@v4 |
40 | 22 | with: |
41 | | - node-version: 18 |
| 23 | + node-version: 20 |
42 | 24 | registry-url: https://registry.npmjs.org/ |
43 | 25 | scope: "@smakss" |
44 | 26 | cache: pnpm |
45 | 27 | - run: pnpm install --frozen-lockfile |
46 | | - - run: pnpm generate |
47 | | - - run: | |
48 | | - if grep -q "beta" package.json; then |
49 | | - echo "Publishing Beta to npm" |
50 | | - npm publish --tag beta |
51 | | - else |
52 | | - echo "Publishing Release to npm" |
53 | | - npm publish |
54 | | - fi |
55 | | - env: |
56 | | - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |
57 | | -
|
58 | | - publish-gpr: |
59 | | - needs: build |
60 | | - runs-on: ubuntu-latest |
61 | | - steps: |
62 | | - - uses: actions/checkout@v4 |
63 | | - - uses: actions/download-artifact@v4 |
64 | | - with: |
65 | | - name: built-package |
66 | | - - uses: pnpm/action-setup@v4 |
67 | | - with: |
68 | | - version: 10 |
69 | | - - uses: actions/setup-node@v4 |
70 | | - with: |
71 | | - node-version: 18 |
72 | | - registry-url: https://npm.pkg.github.com/ |
73 | | - scope: "@smakss" |
74 | | - cache: pnpm |
75 | | - - run: pnpm install --frozen-lockfile |
76 | | - - run: pnpm generate |
77 | | - - run: | |
78 | | - if grep -q "beta" package.json; then |
79 | | - echo "Publishing Beta to GitHub Package Registry" |
80 | | - npm publish --tag beta |
81 | | - else |
82 | | - echo "Publishing Release to GitHub Package Registry" |
83 | | - npm publish |
84 | | - fi |
| 28 | + - run: pnpm build |
| 29 | + - run: pnpm release |
85 | 30 | env: |
86 | | - NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} |
| 31 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 32 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
0 commit comments