Merge pull request #1 from Doczilla-APP/improvements #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- 'package.json' | |
- 'CHANGELOG.md' | |
permissions: | |
contents: write | |
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: Conventional Changelog Action | |
id: changelog | |
uses: TriPSs/conventional-changelog-action@v4 | |
with: | |
github-token: ${{ secrets.github_token }} | |
skip-on-empty: false | |
- 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 | |
- 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 }} |