-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (37 loc) · 1.06 KB
/
generate-version.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
# .github/workflows/generate-version.yml
name: Generate tag version
on:
workflow_dispatch:
inputs:
version:
description: New version
required: true
default: "patch"
type: choice
options:
- patch
- minor
- major
jobs:
version:
name: Create new version ${{ github.event.inputs.version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
- run: |
git config user.name github-actions
git config user.email [email protected]
- name: Use Node.js 14
uses: actions/setup-node@v3
with:
node-version: 14.x
- name: Generate new version
run: npm version ${{ github.event.inputs.version }}
- name: Push new version tag to repository
env:
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
run: |
git remote set-url origin https://x-access-token:${{ secrets.PAT_TOKEN }}@github.com/${{ github.repository }}
git push origin main --tags