---
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 }}
new-release-version:
description: If a new release will be published, the version of the new release. The value is a string, for example '1.3.0'.
value: ${{ jobs.get-next-version.outputs.new-release-version }}
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 }}
new-release-version: ${{ steps.get-next-version.outputs.new-release-version }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Configure Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Cache action npm dependencies
uses: actions/cache@v3
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