Continuous Delivery #119
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Delivery | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'what version to release' | |
required: true | |
type: string | |
dry: | |
description: 'Dry run' | |
required: false | |
type: boolean | |
# push: | |
# branches: | |
# - main | |
jobs: | |
publish: | |
name: Publish to NPM | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Project | |
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ 'main' }} | |
token: ${{secrets.GH_TOKEN}} | |
- name: Use Node.js v22 | |
uses: josh-development/.github/setup-node@main | |
with: | |
version: 22 | |
- name: Build | |
run: yarn build | |
- name: Setup Git | |
run: | | |
git config --global user.name 'DanCodes' | |
git config --global user.email '[email protected]' | |
- name: Bump Version & Publish | |
if: ${{ inputs.dry }} | |
run: yarn release-it --ci -i ${{ inputs.version }} -d | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
- name: Set Version & Publish | |
if: ${{ !inputs.dry && github.event_name == 'workflow_dispatch' }} | |
run: | | |
yarn release-it --ci -i ${{ inputs.version }} | |
git push | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Bump Version & Publish | |
if: ${{ !inputs.dry && github.event_name == 'push' }} | |
run: | | |
yarn release-it --ci | |
git push | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |