Skip to content

Commit 12c6891

Browse files
authored
Merge pull request #17 from buildo/ci_release
Ci release
2 parents 356e462 + 331b669 commit 12c6891

7 files changed

+97
-7
lines changed

.github/release-drafter.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
template: |
2+
## What’s Changed
3+
$CHANGES
4+
categories:
5+
- title: "🐞 Bug fixes"
6+
labels:
7+
- "bug"
8+
- title: "🔧 Dependency updates"
9+
labels:
10+
- "dependencies"
11+
- title: "🧹 Chores"
12+
labels:
13+
- "chore"

.github/workflows/release-drafter.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
update_release_draft:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: release-drafter/release-drafter@v5
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.smooth-releaserc

-5
This file was deleted.

ci/pipeline.yml

+25
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,24 @@ resources:
3737
url: ((buildo-slack-hook))
3838
icon: slack
3939

40+
- name: release
41+
type: git
42+
icon: github
43+
webhook_token: 0gd4XZNL4Y94zYDLql3C
44+
check_every: 24h
45+
source:
46+
uri: [email protected]:buildo/bento-design-system
47+
branch: main
48+
tag_filter: v*
49+
private_key: ((private-key))
50+
4051
jobs:
52+
- name: update-pipeline
53+
plan:
54+
- get: bento
55+
trigger: true
56+
- set_pipeline: self
57+
file: bento/ci/pipeline.yml
4158
- name: main
4259
plan:
4360
- get: bento
@@ -166,3 +183,11 @@ jobs:
166183

167184
- task: chromatic
168185
file: bento/ci/tasks/chromatic.yml
186+
187+
- name: release
188+
plan:
189+
- get: bento
190+
resource: release
191+
trigger: true
192+
- task: release
193+
file: bento/ci/tasks/release.yml

ci/tasks/release.sh

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
LATEST_TAG=$(git describe --tags)
6+
VERSION=${LATEST_TAG#v}
7+
8+
mkdir -p $HOME/.ssh
9+
ssh-keyscan github.com >> $HOME/.ssh/known_hosts
10+
echo "$SSH_PRIVATE_KEY" > $HOME/.ssh/id_rsa
11+
chmod 400 $HOME/.ssh/id_rsa
12+
13+
git config --global user.email "[email protected]"
14+
git config --global user.name "Nemobot"
15+
16+
yarn install --no-progress
17+
yarn version --no-git-tag-version --new-version $VERSION
18+
19+
git add .
20+
git commit -m "v$VERSION"
21+
git push origin HEAD:main
22+
23+
echo "//registry.yarnpkg.com/:_authToken=$NPM_TOKEN" >> $HOME/.npmrc
24+
yarn publish --non-interactive

ci/tasks/release.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
platform: linux
2+
3+
image_resource:
4+
type: docker-image
5+
source:
6+
repository: node
7+
8+
inputs:
9+
- name: bento
10+
11+
caches:
12+
- path: bento/.pnpm-store
13+
14+
params:
15+
NPM_TOKEN: ((npm_token))
16+
SSH_PRIVATE_KEY: ((private-key))
17+
18+
run:
19+
path: ci/tasks/release.sh
20+
dir: bento

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
"prepare": "husky install",
2121
"playroom-start": "playroom start",
2222
"playroom-build": "playroom build",
23-
"build-storybook": "build-storybook",
24-
"release-version": "smooth-release"
23+
"build-storybook": "build-storybook"
2524
},
2625
"repository": {
2726
"type": "git",

0 commit comments

Comments
 (0)