generated from NatoBoram/gigachad.ts
-
Notifications
You must be signed in to change notification settings - Fork 1
96 lines (78 loc) · 2.55 KB
/
pnpm-version-patch.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
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Node.js Patch
on: workflow_dispatch
jobs:
patch:
runs-on: ubuntu-latest
if: github.actor != 'nektos/act' && github.ref_name == 'main'
permissions:
contents: write
outputs:
version: ${{ steps.patch.outputs.VERSION }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
ssh-key: ${{ secrets.DEPLOY_KEY_PRIVATE }}
- uses: pnpm/action-setup@v4
with:
version: latest
- id: patch
run: |
echo "VERSION=$(pnpm version patch --no-git-tag-version)" >> "$GITHUB_OUTPUT"
git add .
- id: commit
uses: qoomon/actions--create-commit@v1
with:
message: 🔖 ${{ steps.patch.outputs.VERSION }}
- name: Push
run: |
eval `ssh-agent -s`
ssh-add - <<< "$DEPLOY_KEY_PRIVATE"
git push
env:
DEPLOY_KEY_PRIVATE: ${{ secrets.DEPLOY_KEY_PRIVATE }}
- run: gh release create "$VERSION" --generate-notes --target "$COMMIT" --title "$VERSION"
env:
COMMIT: ${{ steps.commit.outputs.commit }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.patch.outputs.VERSION }}
publish:
runs-on: ubuntu-latest
needs: patch
permissions:
contents: write # Upload the release files
id-token: write # Add `--provenance`
packages: write # Publish the package
if: github.actor != 'nektos/act'
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.patch.outputs.version }}
- uses: pnpm/action-setup@v4
with:
version: latest
- uses: actions/setup-node@v4
with:
cache: pnpm
node-version: latest
- run: pnpm install
- run: pnpm build
- uses: actions/setup-node@v4
with:
registry-url: https://npm.pkg.github.com
scope: "@coderabbitai"
- run: pnpm publish --access public --no-git-checks --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v4
with:
registry-url: https://registry.npmjs.org
scope: "@coderabbitai"
- run: pnpm publish --access public --no-git-checks --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.CODERABBIT_NPM_TOKEN }}
- run: pnpm pack --pack-gzip-level 9
- run: gh release upload "$VERSION" coderabbitai-bitbucket-*.tgz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ needs.patch.outputs.version }}