-
Notifications
You must be signed in to change notification settings - Fork 8
68 lines (58 loc) · 1.75 KB
/
continuous-delivery.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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@11bd71901bbe5b1630ceea73d27597364c9af683 # 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 }}