-
Notifications
You must be signed in to change notification settings - Fork 40
157 lines (129 loc) · 4.75 KB
/
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: release
on:
# release:
# types: [released]
workflow_dispatch:
jobs:
merge-rc:
runs-on: ubuntu-latest
steps:
- name: Checkout branch dev
uses: actions/checkout@v3
with:
ref: dev
- uses: actions/setup-node@v3
- name: Get tags versions
id: get-tags
uses: JinoArch/get-latest-tag@latest
- name: Get lts version
id: split-lts-tag
uses: jungwinter/split@v2
with:
msg: '${{ steps.get-tags.outputs.latestTag }}'
separator: 'v'
- name: Merge branch rc${{ steps.split-lts-tag.outputs._1 }} into main
uses: everlytic/[email protected]
with:
github_token: ${{ secrets.PAT }}
source_ref: rc${{ steps.split-lts-tag.outputs._1 }}
target_branch: 'main'
commit_message_template: 'Merged rc${{ steps.split-lts-tag.outputs._1 }} into main. [skip ci]'
compile-prod:
needs: merge-rc
runs-on: ubuntu-latest
steps:
- name: Checkout branch main
uses: actions/checkout@v3
with:
ref: main
- name: Install project dependencies
run: npm install
- name: Compile Production code
run: npm run build
- name: Sign and commit compiled code to branch main
uses: ./.github/os-git-actions/signed-commit/
with:
branch: main
message: 'Compiled Production Mode [skip ci]'
newFiles: true
gpgPriv: ${{ secrets.GPG_SIGN_KEY }}
gpgPassPhrase: ${{ secrets.GPG_PASSPHRASE }}
update-doc:
needs: compile-prod
runs-on: ubuntu-latest
steps:
- name: Checkout branch main
uses: actions/checkout@v3
with:
ref: main
token: ${{ secrets.PAT }}
- uses: actions/setup-node@v3
- name: Install project dependencies
run: npm install
- name: Install graphviz
run: sudo apt install -y graphviz
- name: Generate documentation
run: npm run docs
- name: Sign and commit documentation to branch main
uses: ./.github/os-git-actions/signed-commit/
with:
branch: main
message: 'Update documentation [skip ci]'
newFiles: true
gpgPriv: ${{ secrets.GPG_SIGN_KEY }}
gpgPassPhrase: ${{ secrets.GPG_PASSPHRASE }}
deploy-doc:
needs: update-doc
runs-on: ubuntu-latest
steps:
- name: Checkout branch main
uses: actions/checkout@v3
with:
ref: main
- uses: actions/setup-node@v3
- name: Push documentation files into github page
uses: GuillaumeFalourd/copy-push-files@v1
with:
source_files: docs/*
remote_repository: https://github.com/outsystems-ui-docs/outsystems-ui-docs.github.io
access_token: ${{ secrets.UICOMPONENTSDOCS }}
target_branch: main
commit_message: Deploy documentation.
publish-npm:
needs: update-doc
runs-on: ubuntu-latest
steps:
- name: Checkout branch main
uses: actions/checkout@v3
with:
ref: main
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- name: Publish new version to NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_UICOMPONENTS}}
delete-rc:
needs: [deploy-doc, publish-npm]
runs-on: ubuntu-latest
steps:
- name: Checkout branch main
uses: actions/checkout@v3
with:
ref: main
- uses: actions/setup-node@v3
- name: Get tags versions
id: get-tags
uses: JinoArch/get-latest-tag@latest
- name: Get latest version
id: split-lts-tag
uses: jungwinter/split@v2
with:
msg: '${{ steps.get-tags.outputs.latestTag }}'
separator: 'v'
- name: Delete branch rc${{ steps.split-lts-tag.outputs._1 }}
shell: bash
run: |
git push origin -d rc${{ steps.split-lts-tag.outputs._1 }}