-
Notifications
You must be signed in to change notification settings - Fork 46
112 lines (96 loc) · 3.32 KB
/
release.yml
File metadata and controls
112 lines (96 loc) · 3.32 KB
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
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# --------------------------------------------------------------------------------------
# This workflow will release the packages.
name: 🚀 Release
on:
push:
branches: [main]
paths-ignore:
- 'LICENSE'
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
concurrency: ${{ github.workflow }}-${{ github.ref }}
env:
GH_TOKEN: ${{ secrets.UI_BOT_TOKEN }}
NPM_TOKEN: ${{ secrets.WSO2_NPM_TOKEN }}
jobs:
release:
name: 📦 Release
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [lts/*]
pnpm-version: [latest]
steps:
- name: ⬇️ Checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ env.GH_TOKEN }}
- name: 🥡 Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ matrix.pnpm-version }}
run_install: false
cache: true
cache-dependency-path: pnpm-lock.yaml
- name: 🟢 Setup node
id: setup-node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: 🧩 Install Dependencies
id: install-dependencies
run: pnpm install --frozen-lockfile
- name: 🏗️ Build
id: build
run: pnpm build
- name: 📣 Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1.4.9
with:
title: '[Release] [GitHub Action] Update package versions'
publish: pnpm publish:packages
version: pnpm version:packages
commit: "[WSO2 Release] [GitHub Action] [Release] [${{ github.ref_name }}] [skip ci] update package versions"
env:
NPM_TOKEN: ${{ env.NPM_TOKEN }}
GITHUB_TOKEN: ${{ env.GH_TOKEN }}
- name: ⚙️ Setup Pages to Deploy Documentation
if: steps.changesets.outputs.published == 'true'
id: setup-pages
uses: actions/configure-pages@v5
- name: 🌩 Upload Documentation Artifact
if: steps.changesets.outputs.published == 'true'
id: upload-artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./packages/oxygen-ui-docs/dist
- name: 🔥 Deploy to GitHub Pages
if: steps.changesets.outputs.published == 'true'
id: deploy-gh-pages
uses: actions/deploy-pages@v4