Files
eslint-config/.gitea/workflows/build-on-tag.yml
2025-12-21 19:40:32 +01:00

54 lines
1.5 KiB
YAML

name: Build ESLint Config and Release
on:
push:
branches:
- main
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Build
run: bun run build
- name: Copy generated file to repo
run: |
cp dist/index.js index.js
git config user.name "gitea-actions[bot]"
git config user.email "gitea-actions[bot]@users.noreply.gitea.com"
git add index.js
git commit -m "chore: update generated index.js" || echo "No changes to commit"
git push origin main
- name: Get version from package.json
id: pkg
run: |
VERSION=$(node -p "require('./package.json').version")
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Create git tag
run: |
git config user.name "gitea-actions[bot]"
git config user.email "gitea-actions[bot]@users.noreply.gitea.com"
git tag ${{ steps.pkg.outputs.version }}
git push --force origin ${{ steps.pkg.outputs.version }}
- name: Create release
uses: akkuman/gitea-release-action@v1
with:
name: ${{ steps.pkg.outputs.version }}
tag_name: ${{ steps.pkg.outputs.version }}