-
Notifications
You must be signed in to change notification settings - Fork 28
83 lines (77 loc) · 2.46 KB
/
release-please.yml
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: Build and release client
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
release-client:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
- name: Checkout
uses: actions/checkout@v4
- name: setup node
uses: actions/setup-node@v4
with:
node-version: "20.x"
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
- name: Install dependencies
run: pnpm install
- name: Release as beta
if: ${{ ! steps.release.outputs.release_created }}
run: |
# update package version
pnpm version prerelease --no-commit-hooks --no-git-tag-version
# push changes
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git commit -m "fix(ci): bump beta version"
git push
# now create zip file
pnpm run build
echo ${BETA_VERSION} > dist/version.txt
mkdir -p tmp/client
rsync -ar LICENSE dist tmp/client/
cd tmp
zip -X -r client.zip client
- name: Upload by ftp
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
if: ${{ ! steps.release.outputs.release_created }}
with:
server: ${{ secrets.PNM_FTP_HOST }}
username: ${{ secrets.PNM_FTP_USER }}
password: ${{ secrets.PNM_FTP_PASSWORD }}
local-dir: "./tmp/"
state-name: ".client-sync-state.json"
exclude: |
**/client/**
- name: To rebase again
uses: googleapis/release-please-action@v4
if: ${{ ! steps.release.outputs.release_created }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
- name: Release as production
if: ${{ steps.release.outputs.release_created }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pnpm run build
## save latest version tag
echo ${{ steps.release.outputs.tag_name }} > dist/version.txt
mkdir -p tmp/client
rsync -ar LICENSE dist tmp/client/
cd tmp
zip -X -r client.zip client
gh release upload ${{ steps.release.outputs.tag_name }} client.zip