Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle release in a seperate pipeline #2

Merged
merged 6 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 10 additions & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
name: Test & Publish
on: [push, pull_request]
name: Core-Pipeline
on:
push:
branches:
- master
- develop
- 'hotfix/**'
- 'feature/**'
pull_request:

jobs:
test:
Expand Down Expand Up @@ -33,25 +40,4 @@ jobs:
with:
bun-version: latest
- name: Build
run: bun ./build.ts
publish:
name: Publish
needs: build
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Build
run: bun ./build.ts
- name: Setup Node for npm
uses: actions/setup-node@v4
with:
node-version: 20
- name: Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: bun ./build.ts
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install
run: bun install
- name: Lint & Fix
run: bun run lint:fix
- name: Test
run: bun test --coverage
publish:
name: Build & Publish
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Build
run: bun ./build.ts
- name: Setup Node for npm
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- name: Publish
run: npm publish --scope=@cotton-coding
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}