Skip to content

Commit

Permalink
automate release
Browse files Browse the repository at this point in the history
  • Loading branch information
SegaraRai committed Jan 5, 2025
1 parent 743f98e commit ff8627c
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/tough-camels-provide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fraci": minor
---

Automate release.
50 changes: 50 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Publish

on:
push:
branches:
- main

permissions:
contents: write
issues: write
pull-requests: write
id-token: write

jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v4

- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: bun install

- name: Build
run: bun run build

- name: Type check
run: bun run typecheck

- name: Test
run: bun test

- name: Package type check
run: bun run attw

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
version: bun run changeset-version
publish: bun run changeset-publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: "true"
4 changes: 0 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@ name: Test

on:
pull_request:
push:
branches:
- main

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest

timeout-minutes: 10

steps:
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"author": "SegaraRai",
"repository": "https://github.com/SegaraRai/fraci.git",
"scripts": {
"changeset-version": "changeset version",
"changeset-publish": "bun publish && git push --follow-tags",
"build": "tsup && bun run ./fix-dts.ts",
"test": "bun test",
"typecheck": "tsc --noEmit",
Expand Down

0 comments on commit ff8627c

Please sign in to comment.