-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: added workflows to build and publish
- Loading branch information
1 parent
1941a5d
commit 3864233
Showing
2 changed files
with
75 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- uses: oven-sh/setup-bun@v1 | ||
with: | ||
bun-version: latest | ||
|
||
- run: bun install --ignore-scripts --no-progress | ||
- run: bun test | ||
- run: cd packages/tw-lite && bun typecheck | ||
- run: cd packages/tw-lite && bun run build | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: artifacts | ||
path: packages/tw-lite/dist | ||
|
||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/main' | ||
needs: | ||
- build | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Create changelog | ||
id: changelog | ||
uses: TriPSs/conventional-changelog-action@v3 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
git-push: "false" | ||
skip-version-file: "true" | ||
output-file: "false" | ||
skip-commit: "true" | ||
skip-on-empty: "true" | ||
skip-tag: "true" | ||
|
||
- uses: actions/download-artifact@v3 | ||
if: ${{ steps.changelog.outputs.skipped == 'false' }} | ||
with: | ||
name: artifacts | ||
path: packages/tw-lite/dist | ||
|
||
- name: Create Release | ||
run: gh release create "$TAG_NAME" --notes "$BODY" | ||
if: ${{ steps.changelog.outputs.skipped == 'false' }} | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
TAG_NAME: ${{ steps.changelog.outputs.tag }} | ||
BODY: ${{ steps.changelog.outputs.clean_changelog }} | ||
|
||
- uses: actions/setup-node@v3 | ||
if: ${{ steps.changelog.outputs.skipped == 'false' }} | ||
with: | ||
node-version: 20 | ||
|
||
- run: npm publish | ||
if: ${{ steps.changelog.outputs.skipped == 'false' }} | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
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