Skip to content

Merge pull request #173 from sawa-ko/renovate/all-minor-patch #198

Merge pull request #173 from sawa-ko/renovate/all-minor-patch

Merge pull request #173 from sawa-ko/renovate/all-minor-patch #198

name: Continuous Delivery
on:
workflow_dispatch:
inputs:
prNumber:
description: The number of the PR that is being deployed
required: true
ref:
description: The branch that is being deployed. Should be a branch on the given repository
required: false
default: main
repository:
description: The {owner}/{repository} that is being deployed.
required: false
default: kaname-png/revoltx
push:
branches:
- main
jobs:
Publish:
name: Publish Next to npm
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
with:
fetch-depth: 0
repository: ${{ github.event.inputs.repository || 'kaname-png/revoltx' }}
ref: ${{ github.event.inputs.ref || 'main' }}
- name: Add TypeScript problem matcher
run: echo "::add-matcher::.github/problemMatchers/tsc.json"
- name: Use Node.js v16
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # tag=v3
with:
node-version: 16
cache: yarn
registry-url: https://registry.npmjs.org/
- name: Install Dependencies
run: yarn --immutable
- name: Bump Version & Publish
run: |
# Resolve the tag to be used. "next" for push events, "pr-{prNumber}" for dispatch events.
TAG=$([[ ${{ github.event_name }} == 'push' ]] && echo 'next' || echo 'pr-${{ github.event.inputs.prNumber }}')
# Bump the version
yarn standard-version --skip.commit --skip.tag --prerelease "${TAG}.$(git rev-parse --verify --short HEAD)"
# Publish to NPM
npm publish --tag ${TAG} || true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}