Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
zjkmxy committed Jan 16, 2024
1 parent 322073a commit 6007758
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
50 changes: 50 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Publish

on:
# Runs on pushes targeting the default branch
push:
# Pattern matched against refs/tags
tags:
- 'v*' # Push events to every tag not containing /

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Down scope as necessary via https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
permissions:
checks: write
contents: read

jobs:
publish:
name: Publish NPM package
runs-on: ubuntu-latest
if: github.repository == 'UCLA-IRL/ndnts-aux'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 21
cache: "pnpm"
- name: Set up Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Install dependencies
run: pnpm install
- name: DNT build
run: pnpm build
- name: Login
run: |
- pnpm set registry "http://npm.pkg.github.com/"
- pnpm set "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}"
- pnpm login --scope=@ucla-irl
- name: Publish
run:
cd dist && pnpm publish
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ucla-irl/ndnts-aux",
"version": "1.0.1",
"version": "1.0.2",
"description": "NDNts Auxiliary Package for Web and Deno",
"scripts": {
"test": "deno test",
Expand Down

0 comments on commit 6007758

Please sign in to comment.