-
Notifications
You must be signed in to change notification settings - Fork 6
142 lines (121 loc) · 5.42 KB
/
release.yml
File metadata and controls
142 lines (121 loc) · 5.42 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
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
name: Release packages
on:
workflow_dispatch:
inputs:
package:
type: 'choice'
required: true
description: 'Select a package to run the release'
options:
- all
- dialtone
- combinator
- css
- emojis
- icons
- language-server
- tokens
- vue3
- eslint-plugin
- stylelint-plugin
- postcss-responsive-variations
- dialtone-mcp-server
schedule:
- cron: "0 10 * * 2"
permissions:
packages: read
env:
HUSKY: 0
jobs:
get-branch-name:
runs-on: ubuntu-latest
outputs:
current_branch: ${{ steps.branch-name.outputs.current_branch }}
steps:
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v8
# check-dialpad-member:
# runs-on: ubuntu-latest
# steps:
# # Will prevent the rest of the steps from running on fail
# - name: Check if user is a dialpad member
# uses: octokit/request-action@v2.x
# env:
# GITHUB_TOKEN: ${{ secrets.DIALTONE_CI_TOKEN }}
# with:
# route: GET /orgs/dialpad/members/${{ github.actor }}
release:
needs: [get-branch-name]
if: ${{ contains(fromJSON('["staging", "alpha", "beta", "next"]'), needs.get-branch-name.outputs.current_branch) }}
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
issues: write
pull-requests: write
env:
RELEASE_TAG: ${{ needs.get-branch-name.outputs.current_branch == 'staging' && 'latest' || needs.get-branch-name.outputs.current_branch }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.DIALTONE_CI_TOKEN }}
- name: Setup Environment
uses: ./.github/actions/setup-environment
# Release to GitHub
- name: Release Dialtone Combinator ${{ env.RELEASE_TAG }}
if: ${{ github.event_name == 'schedule' || github.event.inputs.package == 'all' || github.event.inputs.package == 'combinator' }}
run: pnpm nx run dialtone-combinator:release
- name: Release Dialtone CSS ${{ env.RELEASE_TAG }}
if: ${{ github.event_name == 'schedule' || github.event.inputs.package == 'all' || github.event.inputs.package == 'css' }}
run: pnpm nx run dialtone-css:release
- name: Release Dialtone Emojis ${{ env.RELEASE_TAG }}
if: ${{ github.event_name == 'schedule' || github.event.inputs.package == 'all' || github.event.inputs.package == 'emojis' }}
run: pnpm nx run dialtone-emojis:release
- name: Release Dialtone Icons ${{ env.RELEASE_TAG }}
if: ${{ github.event_name == 'schedule' || github.event.inputs.package == 'all' || github.event.inputs.package == 'icons' }}
run: pnpm nx run dialtone-icons:release
- name: Release Dialtone Language server ${{ env.RELEASE_TAG }}
if: ${{ github.event_name == 'schedule' || github.event.inputs.package == 'all' || github.event.inputs.package == 'language-server' }}
run: pnpm nx run dialtone-language-server:release
- name: Release Dialtone Tokens ${{ env.RELEASE_TAG }}
if: ${{ github.event_name == 'schedule' || github.event.inputs.package == 'all' || github.event.inputs.package == 'tokens' }}
run: pnpm nx run dialtone-tokens:release
- name: Release Dialtone Vue ${{ env.RELEASE_TAG }}
if: ${{ github.event_name == 'schedule' || github.event.inputs.package == 'all' || github.event.inputs.package == 'vue3' }}
run: pnpm nx run dialtone-vue:release
- name: Release Dialtone ESLint Plugin ${{ env.RELEASE_TAG }}
if: ${{ github.event_name == 'schedule' || github.event.inputs.package == 'all' || github.event.inputs.package == 'eslint-plugin' }}
run: pnpm nx run eslint-plugin-dialtone:release
- name: Release Dialtone StyleLint Plugin ${{ env.RELEASE_TAG }}
if: ${{ github.event_name == 'schedule' || github.event.inputs.package == 'all' || github.event.inputs.package == 'stylelint-plugin' }}
run: pnpm nx run stylelint-plugin-dialtone:release
- name: Release Dialtone PostCSS Responsive Variations Plugin ${{ env.RELEASE_TAG }}
if: ${{ github.event_name == 'schedule' || github.event.inputs.package == 'all' || github.event.inputs.package == 'postcss-responsive-variations' }}
run: pnpm nx run postcss-responsive-variations:release
- name: Release Dialtone MCP Server ${{ env.RELEASE_TAG }}
if: ${{ github.event_name == 'schedule' || github.event.inputs.package == 'all' || github.event.inputs.package == 'dialtone-mcp-server' }}
run: pnpm nx run dialtone-mcp-server:release
- name: Release Dialtone ${{ env.RELEASE_TAG }}
if: ${{ github.event_name == 'schedule' || github.event.inputs.package == 'all' || github.event.inputs.package == 'dialtone' }}
run: pnpm nx run dialtone:release
update-production:
needs: [ release ]
if: ${{ needs.get-branch-name.outputs.current_branch == 'staging' }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: 'production'
fetch-depth: 0
token: ${{ secrets.DIALTONE_CI_TOKEN }}
- name: Merge changes to production
run: |
git merge --ff-only origin/staging
git push