Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
UPSTASH_EMAIL=you@example.com
UPSTASH_API_KEY=your_dev_api_key
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
name: Build & Typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 24

- run: npm ci

- run: npm run build

- run: npm run typecheck

test:
name: Tests
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 24

- run: npm ci

- name: Run tests
env:
UPSTASH_EMAIL: ${{ secrets.UPSTASH_EMAIL }}
UPSTASH_API_KEY: ${{ secrets.UPSTASH_API_KEY }}
run: npm test
65 changes: 13 additions & 52 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,67 +5,28 @@ on:
types:
- published

permissions:
id-token: write
contents: read

jobs:
npm:
name: Release on npm
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2

- name: Set env
run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: 16

- run: curl -fsSL https://deno.land/x/install/install.sh | sh
node-version: 24
registry-url: https://registry.npmjs.org

- run: echo "$HOME/.deno/bin" > $GITHUB_PATH
- run: npm ci

- name: Build
run: deno run -A ./cmd/build.ts $VERSION
- name: Publish release candidate
if: github.event.release.prerelease
run: npm publish --access public --tag next --provenance

- name: Publish
if: "!github.event.release.prerelease"
working-directory: ./dist
run: |
echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" > .npmrc
npm publish --access public

- name: Publish release candidate
if: "github.event.release.prerelease"
working-directory: ./dist
run: |
echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" > .npmrc
npm publish --access public --tag=next

binaries:
name: Release binary
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch:
[
"x86_64-unknown-linux-gnu",
"x86_64-pc-windows-msvc",
"x86_64-apple-darwin",
"aarch64-apple-darwin",
]
steps:
- name: Checkout Repo
uses: actions/checkout@v2

- run: curl -fsSL https://deno.land/x/install/install.sh | sh
- run: echo "$HOME/.deno/bin" > $GITHUB_PATH

- name: compile
run: deno compile --allow-env --allow-read --allow-write --allow-net --target=${{ matrix.arch }} --output=./bin/upstash_${{ matrix.arch}} ./src/mod.ts

- name: upload
run: gh release upload ${GITHUB_REF#refs/*/} ./bin/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm publish --access public --provenance
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.env
dist
node_modules
23 changes: 0 additions & 23 deletions Makefile

This file was deleted.

Loading
Loading