Skip to content

Commit

Permalink
Create release action
Browse files Browse the repository at this point in the history
  • Loading branch information
npv2k1 committed Sep 5, 2023
1 parent a16a4d4 commit c508fe7
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
on:
push:
tags:
- "v*"

name: Create Release

jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup

- name: Build package
run: yarn prepack

- uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true

30 changes: 30 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish Release
on:
release:
types:
- published

jobs:
publish-release:
name: Publish Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup

- name: Build package
run: yarn prepack

- name: Publish
run: |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
if [[ "${{ github.event.release.tag_name }}" == *"beta"* ]]; then
npm publish --tag beta
else
npm publish
fi
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit c508fe7

Please sign in to comment.