-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from upstash/github-workflows
Add github workflows
- Loading branch information
Showing
2 changed files
with
77 additions
and
0 deletions.
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,48 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set env | ||
run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
|
||
- name: Setup Bun | ||
uses: oven-sh/setup-bun@v1 | ||
with: | ||
bun-version: latest | ||
|
||
- name: Set package version | ||
run: echo $(jq --arg v "${{ env.VERSION }}" '(.version) = $v' package.json) > package.json | ||
|
||
- name: Install Dependencies | ||
run: bun install | ||
|
||
- name: Build | ||
run: bun run build | ||
|
||
- name: Set NPM_TOKEN | ||
run: npm set "//registry.npmjs.org/:_authToken" ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Publish | ||
if: "!github.event.release.prerelease" | ||
working-directory: ./dist | ||
run: | | ||
npm pkg delete scripts.prepare | ||
npm publish --access public | ||
- name: Publish release candidate | ||
if: "github.event.release.prerelease" | ||
working-directory: ./dist | ||
run: | | ||
npm pkg delete scripts.prepare | ||
npm publish --access public --tag=canary |
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,29 @@ | ||
name: Tests | ||
on: | ||
pull_request: | ||
|
||
env: | ||
QSTASH_TOKEN: ${{ secrets.QSTASH_TOKEN }} | ||
|
||
jobs: | ||
local-tests: | ||
runs-on: ubuntu-latest | ||
|
||
name: Upstash Workflow Tests | ||
steps: | ||
- name: Setup repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Bun | ||
uses: oven-sh/setup-bun@v1 | ||
with: | ||
bun-version: latest | ||
|
||
- name: Install Dependencies | ||
run: bun install | ||
|
||
- name: Run tests | ||
run: bun run test | ||
|
||
- name: Build | ||
run: bun run build |