Skip to content

Commit 4bb68f8

Browse files
committed
CI: added release workflows
1 parent 1fe4cee commit 4bb68f8

File tree

10 files changed

+112
-153
lines changed

10 files changed

+112
-153
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NPM_ACCESS_TOKEN=

.github/actions/build/action.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/prerelease.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI/CD Prerelease
2+
run-name: Prerelease
3+
4+
on:
5+
push:
6+
branches:
7+
- development
8+
workflow_dispatch:
9+
inputs:
10+
tag:
11+
type: choice
12+
description: "Choose a prerelease tag"
13+
options:
14+
- blizzard
15+
- dev
16+
17+
jobs:
18+
package-release:
19+
name: Publish
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout repository 🛎️
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Build 🏗️
28+
uses: sliit-foss/actions/bun/build@main
29+
30+
- name: Release 🚀
31+
uses: sliit-foss/actions/bun/publish@main
32+
env:
33+
TAG: ${{ inputs.tag || 'blizzard' }}
34+
NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
35+
Lines changed: 30 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,35 @@
1-
# name: Quality Checks
1+
name: CI Quality Checks
2+
run-name: Quality Checks
23

3-
# on:
4-
# pull_request:
5-
# branches:
6-
# - main
7-
# types:
8-
# - opened
9-
# - reopened
10-
# - synchronize
4+
on:
5+
pull_request:
6+
branches:
7+
- main
8+
- development
9+
types:
10+
- opened
11+
- reopened
12+
- synchronize
1113

12-
# jobs:
13-
# commitlint:
14-
# name: Commitlint
15-
# runs-on: ubuntu-latest
16-
# steps:
17-
# - name: Checkout repository 🛎️
18-
# uses: actions/checkout@v3
14+
jobs:
15+
commitlint:
16+
name: Commitlint
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout repository 🛎️
20+
uses: actions/checkout@v4
1921

20-
# - name: Run commitlint 🟩
21-
# uses: sliit-foss/actions/quality-checks/commitlint@main
22+
- name: Run commitlint 🟩
23+
uses: sliit-foss/actions/quality-checks/commitlint@main
2224

23-
# lint:
24-
# name: Enforce ESLint rules
25-
# runs-on: ubuntu-latest
26-
# steps:
27-
# - name: Checkout repository 🛎️
28-
# uses: actions/checkout@v3
25+
lint:
26+
name: Enforce ESLint rules
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout repository 🛎️
30+
uses: actions/checkout@v4
2931

30-
# - name: Run linter 📢
31-
# uses: sliit-foss/actions/quality-checks/linter@main
32-
33-
# format:
34-
# name: Format code
35-
# runs-on: ubuntu-latest
36-
# steps:
37-
# - name: Checkout repository 🛎️
38-
# uses: actions/checkout@v3
39-
40-
# - name: Run formatter 🧹
41-
# uses: sliit-foss/actions/quality-checks/formatter@main
32+
- name: Run linter 📢
33+
uses: sliit-foss/actions/quality-checks/linter@main
34+
with:
35+
package-manager: 'bun'

.github/workflows/release.yml

Lines changed: 28 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,28 @@
1-
# name: CI Release
2-
# run-name: Release
3-
4-
# on:
5-
# push:
6-
# branches:
7-
# - main
8-
9-
# jobs:
10-
# package-release:
11-
# name: Package Release
12-
# runs-on: ubuntu-latest
13-
# steps:
14-
# - name: Checkout repository 🛎️
15-
# uses: actions/checkout@v4
16-
# with:
17-
# fetch-depth: 0
18-
19-
# - name: Build 🏗️
20-
# uses: ./.github/actions/build
21-
22-
# - name: Create .npmrc 📝
23-
# run: |
24-
# echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
25-
# echo "git-checks=false" >> .npmrc
26-
27-
# - name: Bump version 📝
28-
# run: pnpm bump-version
29-
30-
# - name: Publish to registry 🚀
31-
# run: pnpm release
32-
33-
# - name: Sync release info 📝
34-
# id: sync_release
35-
# run: |
36-
# tag=v$(node -e "console.log(require('./package.json').version)")
37-
# git config --global user.email "github-actions[bot]@users.noreply.github.com"
38-
# git config --global user.name "github-actions[bot]"
39-
# git config pull.ff true
40-
# git add . && git commit -m "CI: @sliit-foss/automatic-versioning - sync release" || true
41-
# git tag $tag || true
42-
# git pull --rebase && git push origin
43-
# echo "tag=$tag" >> $GITHUB_OUTPUT
44-
45-
# - name: Create release on GitHub 📝
46-
# uses: ncipollo/release-action@v1
47-
# with:
48-
# generateReleaseNotes: true
49-
# skipIfReleaseExists: true
50-
# makeLatest: true
51-
# tag: ${{steps.sync_release.outputs.tag}}
52-
53-
# site-release:
54-
# name: Site Release
55-
# runs-on: ubuntu-latest
56-
# steps:
57-
# - name: Checkout repository 🛎️
58-
# uses: actions/checkout@v4
59-
60-
# - name: Build 🏗️
61-
# uses: ./.github/actions/build
62-
# with:
63-
# storybooks: true
64-
65-
# - name: Create .nojekyll file 🚧
66-
# run: touch ./storybook-static/.nojekyll
67-
68-
# - name: Fix 404 on page reload 🚧
69-
# run: cp storybook-static/index.html storybook-static/404.html
70-
71-
# - name: Deploy 🚀
72-
# uses: JamesIves/github-pages-deploy-action@v4
73-
# with:
74-
# folder: ./storybook-static/
75-
# branch: gh-pages
76-
# clean-exclude: preview
1+
name: CI/CD Release
2+
run-name: Release
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
package-release:
11+
name: Publish
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repository 🛎️
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Build 🏗️
20+
uses: sliit-foss/actions/bun/build@main
21+
22+
- name: Release 🚀
23+
uses: sliit-foss/actions/bun/publish@main
24+
with:
25+
latest: true
26+
env:
27+
TAG: latest
28+
NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}

.gitignore

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
.cache
2-
dist
3-
node_modules
4-
storybook-static
52
.eslintcache
3+
.env
64
.npmrc
5+
.DS_Store
76

8-
.DS_Store
7+
dist
8+
node_modules
9+
storybook-static

.npmignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
src/
66
test/
77
coverage/
8-
injections
98
node_modules/
109
patches/
1110
storybook-static/

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 SLIIT FOSS Community
3+
Copyright (c) 2024 MEZH HQ
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

bunfig.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[install]
2+
exact = true
3+
4+
[install.scopes]
5+
"@mezh-hq" = { token = "$NPM_ACCESS_TOKEN", url = "https://registry.npmjs.org/" }

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
"scripts": {
1212
"build": "bun run ./esbuild.config.js && bun build:css",
1313
"build:css": "bunx tailwindcss -o ./dist/index.css --minify",
14-
"bump-version": "bun run --bun automatic-versioning --no-commit --recursive --prerelease-tag=blizzard --prerelease-branch=development -name=react-seat-toolkit",
14+
"bump-version": "bunx --bun automatic-versioning --disable-auto-sync --recursive $(if [ \"$TAG\" != \"latest\" ]; then echo --prerelease; fi) --prerelease-branch=development --prerelease-tag=$TAG --name=@mezh-hq/react-seat-toolkit --ignore-prefixes=ci",
1515
"format": "bunx prettier --write --cache \"**/*.{js,jsx,ts,tsx,md,css,yml}\"",
1616
"lint": "bun run --bun eslint . --ext js,jsx,ts,tsx,mdx --ignore-path .gitignore --fix --cache --report-unused-disable-directives",
1717
"storybook": "NODE_ENV=storybook storybook dev -p 6006",
1818
"build-storybook": "storybook build",
1919
"prepare": "lefthook install",
20-
"release": "npm publish --access=public --no-git-checks || true",
20+
"release": "bunx github:akalanka47000/bunpublish --tag=${TAG:=latest}",
2121
"test": "echo \"Error: no test specified\" && exit 1"
2222
},
2323
"keywords": [
@@ -66,7 +66,7 @@
6666
"@commitlint/cli": "17.4.2",
6767
"@commitlint/config-conventional": "17.4.2",
6868
"@interactjs/types": "1.10.26",
69-
"@sliit-foss/automatic-versioning": "2.1.1",
69+
"@sliit-foss/automatic-versioning": "2.3.0",
7070
"@storybook/addon-essentials": "7.3.2",
7171
"@storybook/addon-interactions": "7.3.2",
7272
"@storybook/addon-links": "7.3.2",
@@ -101,5 +101,9 @@
101101
},
102102
"overrides": {
103103
"jsondiffpatch": "^0.5.0"
104+
},
105+
"publishConfig": {
106+
"registry": "https://registry.npmjs.org/",
107+
"access": "public"
104108
}
105109
}

0 commit comments

Comments
 (0)