66 lines
1.5 KiB
YAML
66 lines
1.5 KiB
YAML
name: Release package
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- dev-*
|
|
|
|
jobs:
|
|
release:
|
|
permissions:
|
|
contents: write
|
|
issues: write
|
|
pull-requests: write
|
|
id-token: write
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: latest
|
|
|
|
- uses: pnpm/action-setup@v3
|
|
with:
|
|
version: latest
|
|
run_install: false
|
|
|
|
- name: Get pnpm store directory
|
|
shell: bash
|
|
run: |
|
|
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
|
|
|
- uses: actions/cache@v3
|
|
name: Setup pnpm cache
|
|
with:
|
|
path: ${{ env.STORE_PATH }}
|
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/package.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pnpm-store-
|
|
|
|
- name: Update dependencies
|
|
run: pnpm update
|
|
|
|
- name: Format code
|
|
run: pnpm format
|
|
|
|
- name: Release
|
|
env:
|
|
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
run: pnpm release
|
|
|
|
- name: Commit & Push Changes
|
|
if: always()
|
|
run: |
|
|
if [ -n "$(git status --porcelain)" ]; then
|
|
git config --global user.name "gitea-actions"
|
|
git config --global user.email "actions-user@noreply.git.demonkernel.io.vn"
|
|
|
|
git rm -r --cached .
|
|
git add .
|
|
git commit -m "chore: release [ci skip]"
|
|
git push
|
|
fi |