Skip to content

Commit

Permalink
Add github action to auto publish package (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
G4brym authored Nov 28, 2022
2 parents 55353e5 + a5c4c57 commit 2458360
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
52 changes: 52 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Release & Publish

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false

publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .npmrc file to publish to npm
uses: actions/setup-node@v1
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
- name: Install modules
run: npm install
- name: Build
run: npm run build
- name: Publish to npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- name: Setup .npmrc file to publish to GitHub Packages
uses: actions/setup-node@v1
with:
node-version: '14.x'
registry-url: 'https://npm.pkg.github.com'
scope: '@cloudflare'
- run: npm run addscope
- name: Publish to GitHub Packages
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cloudflare/itty-router-openapi",
"version": "0.0.6",
"version": "0.0.7",
"description": "OpenAPI schema generator and validator for Cloudflare Workers",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down

0 comments on commit 2458360

Please sign in to comment.