-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (70 loc) · 2.04 KB
/
node-release.yaml
File metadata and controls
72 lines (70 loc) · 2.04 KB
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
69
70
71
72
name: Node Release
on:
workflow_call:
inputs:
node_version:
required: false
type: string
default: '22'
node_cache:
required: false
type: string
default: npm
prefix:
required: false
type: string
default: ''
suffix:
required: false
type: string
default: ''
secrets:
# Scopes: Actions:write, Contents:write
GH_TOKEN_RELEASES:
required: true
workflow_dispatch:
jobs:
release:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
runs-on: ubuntu-latest
steps:
- name: Checkout Source Repository
uses: actions/checkout@v4
with:
path: source
- name: Checkout Shared Workflow Repository
uses: actions/checkout@v4
with:
repository: krauters/shared-workflows
path: shared-workflows
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_version }}
cache: ${{ inputs.node_cache }}
cache-dependency-path: source/package-lock.json
- name: Get Version
run: node ./shared-workflows/scripts/get-version.js
- name: Check if Tag Exists
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GH_TOKEN_RELEASES }}
script: |
const script = require('./shared-workflows/scripts/check-tag-exists.js')
await script({ github, context })
- name: Get Release Name
if: env.TAG_EXISTS == 'false'
run: node ./shared-workflows/scripts/get-release-name.js
- name: Delete Local Tags
if: env.TAG_EXISTS == 'false'
run: git tag -d $(git tag -l)
working-directory: ./source
- name: Create GitHub Tag and Release
if: env.TAG_EXISTS == 'false'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GH_TOKEN_RELEASES }}
script: |
const script = require('./shared-workflows/scripts/create-release.js')
await script({ github, context })