Skip to content

Commit d526e2e

Browse files
authored
feat(release): workflow
2 parents 40e18e6 + e6c9764 commit d526e2e

File tree

8 files changed

+6525
-288
lines changed

8 files changed

+6525
-288
lines changed

.github/workflows/pipeline.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# CI/CD Release Workflow
2+
name: pipeline
3+
4+
on:
5+
pull_request:
6+
branches:
7+
- 'release-*'
8+
- 'master'
9+
tags-ignore:
10+
- '*'
11+
env:
12+
CI: ''
13+
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
14+
PULL_NUMBER: ${{ github.event.pull_request.number }}
15+
RUN_ID: ${{ github.run_id }}
16+
FORCE_COLOR: 2
17+
18+
jobs:
19+
pipeline:
20+
name: Node ${{ matrix.node-version }} on ${{ matrix.os }}
21+
runs-on: ${{ matrix.os }}
22+
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
node-version: ['16.x']
27+
os: ['ubuntu-latest']
28+
29+
steps:
30+
- uses: actions/checkout@v3
31+
- name: Use Node.js ${{ matrix.node-version }}
32+
uses: actions/setup-node@v3
33+
with:
34+
node-version: ${{ matrix.node-version }}
35+
36+
- name: Get yarn cache directory path
37+
id: yarn-cache-dir-path
38+
run: echo "::set-output name=dir::$(yarn cache dir)"
39+
40+
- uses: actions/cache@v3
41+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
42+
with:
43+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
44+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
45+
restore-keys: |
46+
${{ runner.os }}-yarn-
47+
48+
- name: Install project
49+
run: yarn --prefer-offline
50+
id: install
51+
52+
- name: Build project
53+
run: yarn run build
54+
id: production
55+
56+
- name: Pack project
57+
run: npm pack
58+
id: pack
59+
60+
- name: Set output info
61+
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
62+
63+
- name: Create automatic release
64+
uses: 'marvinpinto/action-automatic-releases@latest'
65+
if: ${{ github.event_name == 'push'}}
66+
with:
67+
repo_token: '${{ secrets.GITHUB_TOKEN }}'
68+
automatic_release_tag: 'latest'
69+
prerelease: true
70+
files: |
71+
LICENSE.md
72+
**.tgz
73+
id: 'automatic_releases'
74+
75+
76+
release:
77+
# if: startsWith(github.ref, 'refs/tags/')
78+
79+
if: ${{ github.event_name == 'create' && github.event.ref_type == 'tag' }}
80+
81+
runs-on: ubuntu-latest
82+
steps:
83+
- name: Checkout
84+
uses: actions/checkout@v3
85+
86+
- run: echo "Deploying tag ${{ github.ref }}" ;
87+
- name: "Build Changelog"
88+
id: github_release
89+
uses: mikepenz/release-changelog-builder-action@v3
90+
with:
91+
configuration: ".github/workflows/release.json"
92+
env:
93+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94+
95+
- name: Create Release
96+
uses: actions/create-release@v3
97+
with:
98+
tag_name: ${{ github.ref }}
99+
release_name: ${{ github.ref }}
100+
body: ${{steps.github_release.outputs.changelog}}
101+
env:
102+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"categories": [
3+
{
4+
"title": "## 🟢 Features",
5+
"labels": ["feature", "feat", "release"]
6+
},
7+
{
8+
"title": "## 🟠 Fixes",
9+
"labels": ["fix", "bug", "refactor"]
10+
},
11+
{
12+
"title": "## 🟡 CI/CD",
13+
"labels": ["test", "ci", "cd"]
14+
},
15+
{
16+
"title": "## 🔵 Docs",
17+
"labels": ["docs"]
18+
}
19+
],
20+
"sort": "ASC",
21+
"template": "${{CHANGELOG}}\n\n<details>\n<summary>Uncategorized</summary>\n\n${{UNCATEGORIZED}}\n</details>",
22+
"pr_template": "- ${{TITLE}}\n - PR: #${{NUMBER}}",
23+
"empty_template": "- no changes",
24+
"transformers": [
25+
{
26+
"pattern": "[\\-\\*] (\\[(...|TEST|CI|SKIP)\\])( )?(.+?)\n(.+?[\\-\\*] )(.+)",
27+
"target": "- $4\n - $6"
28+
}
29+
],
30+
"max_tags_to_fetch": 200,
31+
"max_pull_requests": 200,
32+
"max_back_track_time_days": 90,
33+
"exclude_merge_branches": [
34+
"Owner/qa"
35+
]
36+
}

.prettierignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# -*- mode: gitignore; -*-
2+
/out
3+
cache/
4+
*.html
5+
*.css
6+
*.svg
7+
*.xml
8+
*.scss
9+
*.min.js
10+
.cache/
11+
build/
12+
dist/

.prettierrc.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
'use strict';
2+
3+
module.exports = {
4+
arrowParens: 'always',
5+
bracketSpacing: true,
6+
endOfLine: 'lf',
7+
jsxBracketSameLine: false,
8+
jsxSingleQuote: false,
9+
printWidth: 100,
10+
proseWrap: 'always',
11+
quoteProps: 'as-needed',
12+
semi: true,
13+
singleQuote: true,
14+
tabWidth: 2,
15+
trailingComma: 'all',
16+
useTabs: false,
17+
};

0 commit comments

Comments
 (0)