Skip to content
Open
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
71 changes: 71 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: release

on:
release:
types: [published]

jobs:
npm-release:
name: Publish to npm
if: github.event.release.prerelease == false
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
working-directory: ./packages/chronicle
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2

- name: Install dependencies
run: bun install --frozen-lockfile
working-directory: .

- name: Build CLI
run: bun build-cli.ts

- name: Bump version
run: |
VERSION="${GITHUB_REF_NAME#v}"
npm version "$VERSION" --no-git-tag-version --allow-same-version

- name: Create .npmrc
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > "$HOME/.npmrc"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish
run: npm publish --access public
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

docker-release:
name: Publish to Docker Hub
if: github.event.release.prerelease == false
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Login to DockerHub
uses: docker/login-action@v4
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set version
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV"

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
raystack/chronicle:${{ env.VERSION }}
raystack/chronicle:latest