-
Notifications
You must be signed in to change notification settings - Fork 5
130 lines (116 loc) · 4.68 KB
/
ci-release.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: CI-RELEASE
on:
push:
branches: ["main"]
paths-ignore:
- "**/README.md"
- "**/workflows/*.yml"
pull_request:
branches: [main]
types: [opened, synchronize]
paths-ignore:
- "**/README.md"
- "**/workflows/*.yml"
jobs:
release:
name: Qryn-View Release
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: pnpm/[email protected]
with:
version: 8
- name: "Automated Version Bump"
if: github.event_name != 'pull_request'
id: version
uses: "phips28/gh-action-bump-version@master"
with:
tag-prefix: "v"
skip-tag: true
minor-wording: 'feat,add,Adds,new'
major-wording: 'MAJOR,cut-major'
patch-wording: 'Fix,patch,fixes,fix,dependabot,deps-dev,deps,Bumps,chore'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Main Package Version Bump"
if: github.event_name != 'pull_request'
id: main-version
uses: "phips28/gh-action-bump-version@master"
with:
tag-prefix: "v"
skip-tag: true
minor-wording: 'feat,add,Adds,new'
major-wording: 'MAJOR,cut-major'
patch-wording: 'Fix,patch,fixes,fix,dependabot,deps-dev,deps,Bumps,chore'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PACKAGEJSON_DIR: 'packages/main'
- name: "version check"
if: github.event_name != 'pull_request'
run: echo ${{steps.version.outputs.newTag}}
- name: "main version check"
if: github.event_name != 'pull_request'
run: echo ${{steps.main-version.outputs.newTag}}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm build
- name: Test
run: pnpm test
- uses: vimtor/[email protected]
if: github.event_name != 'pull_request'
with:
files: packages/main/dist/ README.md
dest: dist.zip
- name: Upload release binaries
if: github.event_name != 'pull_request'
uses: boxpositron/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_config: |
dist.zip
tag_name: ${{steps.version.outputs.newTag}}
release_name: qryn-view-${{steps.version.outputs.newTag}}
draft: false
prerelease: false
overwrite: true
- name: Prepare for Mothership
if: github.event_name != 'pull_request'
uses: GuillaumeFalourd/[email protected]
with:
repository_owner: metrico
repository_name: qryn
new_branch_name: view_${{steps.version.outputs.newTag}}
new_branch_ref: master
access_token: ${{ secrets.GH_PUSH }}
- name: Push to Mothership
if: github.event_name != 'pull_request'
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.GH_PUSH }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
source-directory: "packages/main/dist"
target-directory: "view"
target-branch: view_${{steps.version.outputs.newTag}}
destination-github-username: "metrico"
destination-repository-name: "qryn"
user-email: [email protected]
commit-message: Upgrade view to ${{steps.version.outputs.newTag}}
- name: Deploy to gh-pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: packages/main/dist