Skip to content

Commit

Permalink
ci: automate deployments with semantic-release
Browse files Browse the repository at this point in the history
  • Loading branch information
wopian committed Jan 25, 2023
1 parent cbd5f3a commit b2ce84f
Show file tree
Hide file tree
Showing 12 changed files with 9,886 additions and 3,831 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
index.html linguist-vendored
.yarn/ export-ignore
48 changes: 48 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI

on:
push:
branches: [develop]
workflow_dispatch:
branches: [develop]

env:
FORCE_COLOR: true
NODE_VERSION: 18

jobs:
setup:
name: Deploy Package
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
run: yarn install --immutable

- name: Build Package
run: yarn build

- name: Create Release
if: success() && github.ref == 'refs/heads/develop'
run: yarn semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
node_modules
lib

.yarn/cache
.yarn/unplugged
.yarn/sdks
.yarn/*.gz
.pnp.cjs
.pnp.loader.mjs
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ example.png
index.html
sandbox.config.json
yarn.lock
.yarn
.vscode
11 changes: 11 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
branches:
- develop
debug: true
ci: true
dryRun: false
plugins:
- "@semantic-release/commit-analyzer"
- "@semantic-release/release-notes-generator"
- "@semantic-release/changelog"
- "@semantic-release/github"
- "@semantic-release/npm"
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"arcanis.vscode-zipfs",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"typescript.tsdk": "node_modules\\typescript\\lib",
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
},
"markiscodecoverage.searchCriteria": "coverage/lcov.info"
}
28 changes: 28 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

823 changes: 823 additions & 0 deletions .yarn/releases/yarn-3.3.1.cjs

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cloneConcurrency: 8
defaultSemverRangePrefix: '~'
enableScripts: false
enableTelemetry: false
httpRetry: 3
httpTimeout: 60000
nmMode: classic
nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: '@yarnpkg/plugin-workspace-tools'
yarnPath: .yarn/releases/yarn-3.3.1.cjs
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,19 @@
},
"homepage": "https://github.com/wopian/smooth-corners#readme",
"devDependencies": {
"@semantic-release/changelog": "~6.0.2",
"@semantic-release/commit-analyzer": "~9.0.2",
"@semantic-release/github": "~8.0.7",
"@semantic-release/npm": "~9.0.0",
"@semantic-release/release-notes-generator": "~10.0.3",
"microbundle": "^0.15.0",
"semantic-release": "~20.1.0",
"serve": "^14.0.0"
},
"private": false,
"renovate": {
"extends": [
"github>wopian/renovate-config"
]
}
},
"packageManager": "[email protected]"
}
Loading

0 comments on commit b2ce84f

Please sign in to comment.