Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
44 changes: 44 additions & 0 deletions .github/workflows/npmjs-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build and Upload Package

on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'What version to use for the release'
required: true

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18

- name: Set release version
run: |
tag="${{ github.event.inputs.version }}"
if [ -z "$tag" ]; then
tag="${GITHUB_REF_NAME}"
fi
version="${tag#v}" # Strip leading v

# Bump library tag
npm version --no-git-tag-version "$version"

git config user.name 'GitHub Actions'
git config user.email eng+github@repl.it

git commit -m 'Setting version' package.json

- name: Build and publish
run: |
npm set "//registry.npmjs.org/:_authToken" "${{ secrets.NPMJS_AUTH_TOKEN }}"
npm install --frozen-lockfile
npm run publish
33 changes: 33 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release Drafter

on:
workflow_dispatch: {}
push:
# branches to consider in the event; optional, defaults to all
branches:
- main
# pull_request event is required only for autolabeler
pull_request:
# Only following types are handled by the action, but one can default to all as well
types: [opened, reopened, synchronize]
# pull_request_target event is required for autolabeler to support PRs from forks
pull_request_target:
types: [opened, reopened, synchronize]

permissions:
contents: read

jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading