-
Notifications
You must be signed in to change notification settings - Fork 19
63 lines (57 loc) · 1.8 KB
/
release.yaml
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
name: 0x📦 Release New Version
run-name: 📦 Release ${{ inputs.semver }}/${{ inputs.custom_version }} by @${{ github.actor }} ${{ inputs.dry_run && '(🧪 Dry-Run)' || '' }}
on:
workflow_dispatch:
inputs:
semver:
type: choice
description: Which version you want to increment?
options:
- patch
- minor
- major
required: true
custom_version:
description: Manual Custom Version (Special Purpose, e.g. 1.0.0)
type: string
required: false
dry_run:
description: "Dry run?"
type: boolean
default: false
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
actions: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Calc Version
id: tag_version
uses: mathieudutour/github-tag-action@v6.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: ${{ inputs.semver }}
custom_tag: ${{ inputs.custom_version }}
dry_run: 'true'
- name: Bump version and push tag
if: inputs.dry_run == false
uses: reedyuk/npm-version@1.1.1
with:
version: ${{ steps.tag_version.outputs.new_version }}
git-tag-version: 'true'
- name: Create a GitHub release
if: inputs.dry_run == false
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
draft: ${{ inputs.dry_run }}
- name: Dispatch Build
uses: benc-uk/workflow-dispatch@v1
if: inputs.dry_run == false
with:
workflow: publish.yml