-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (57 loc) · 2.41 KB
/
get_next_version.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
# SPDX-FileCopyrightText: 2024 Cognitive Disorders Research Lab
#
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
---
name: Next semantic-release version
on:
workflow_call:
outputs:
new-release-published:
description: Indicates whether a new release will be published. The value is a string, either 'true' or 'false'.
value: ${{ jobs.get-next-version.outputs.new-release-published }}
jobs:
get-next-version:
name: Get next release version
runs-on: ubuntu-latest
outputs:
new-release-published: ${{ steps.get-next-version.outputs.new-release-published }}
steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
fetch-depth: 0
persist-credentials: false
- name: Configure Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: lts/*
- name: Cache action npm dependencies
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
id: cache-node-modules
with:
path: ${{ runner.temp }}/.semantic-release-action_next-release-version/node_modules
key: |
semantic-release-action/next-release-version-${{ runner.os }}-node-${{ hashFiles('${{ github.action_path }}/package-lock.json') }}
- name: Install dependencies on cache miss
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: |
npm install -g semantic-release semantic-release-export-data
shell: bash
- name: Get next release version
id: get-next-version
env:
GITHUB_TOKEN: ${{secrets.ACTIONS_PAT_GITHUB}}
run: |
: calculate next semantic-release version
semantic-release \
--dry-run \
--plugins semantic-release-export-data \
--verify-conditions semantic-release-export-data \
--verify-release '' \
--generate-notes semantic-release-export-data \
--prepare '' \
--publish '' \
--success '' \
--fail ''
shell: bash