Skip to content

Commit

Permalink
ci: Added release flow
Browse files Browse the repository at this point in the history
  • Loading branch information
TriPSs committed Dec 16, 2023
1 parent ec0e33a commit 0a9d186
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
49 changes: 49 additions & 0 deletions .github/workflows/release-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release (npm)

on:
push:
tags:
- '*'

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache node modules
id: cache
uses: actions/cache@v3
with:
path: |
~/.cache
**/node_modules
key: cache-node-modules-${{ hashFiles('yarn.lock') }}
restore-keys: |
cache-node-modules-
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: yarn install
if: steps.cache.outputs.cache-hit != 'true'
shell: bash
run: yarn install --immutable

- name: Build
shell: bash
run: yarn build

- name: GIT/NPM config
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish
shell: bash
run: npm publish --access public
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release

on:
push:
branches:
- main
paths-ignore:
- 'package.json'
- 'CHANGELOG.md'

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Conventional Changelog Action
id: changelog
uses: TriPSs/conventional-changelog-action@v4
with:
github-token: ${{ secrets.github_token }}

- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
with:
tag_name: ${{ steps.changelog.outputs.tag }}
release_name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}

0 comments on commit 0a9d186

Please sign in to comment.