Skip to content

Commit

Permalink
ci(release): fix github-action
Browse files Browse the repository at this point in the history
  • Loading branch information
wallpants committed Jan 26, 2024
1 parent 6fa9c5d commit d3faeb8
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 58 deletions.
58 changes: 0 additions & 58 deletions .github/workflows/release.yaml

This file was deleted.

66 changes: 66 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Release
on:
pull_request:
push:
branches:
- main

permissions:
contents: read

jobs:
Test:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install --no-save
- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: bun run commitlint --from=origin/main --to=HEAD
- name: Validate code formatting
run: |
bun run format
if [[ $(git status --porcelain) ]]; then
echo "Code not properly formatted. Please run 'bun run format' locally and commit changes."
exit 1
fi
- name: Lint & check types
run: bun run lint
- name: Test
run: bun test

Release:
needs: [Test]
permissions:
contents: write
issues: write
pull-requests: write
if: |
github.ref == 'refs/heads/main' &&
github.event.repository.fork == false
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bun run semantic-release

0 comments on commit d3faeb8

Please sign in to comment.