-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
action.yml
52 lines (49 loc) · 2.2 KB
/
action.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
43
44
45
46
47
48
49
50
51
52
name: 'Publish Release'
description: 'Publish the release'
inputs:
npm-tag:
description: '(Deprecated) This option is no longer used, and will be removed in a future release'
required: false
default: 'latest'
outputs:
release-version:
description: "The version associated with the new release, derived from the primary package's version."
value: ${{ steps.get-release-version.outputs.RELEASE_VERSION }}
runs:
using: 'composite'
steps:
- id: get-version-strategy
shell: bash
run: |
RELEASE_STRATEGY=$([[ -f "release.config.json" ]] && jq --raw-output '.versioningStrategy // "fixed"' "release.config.json" || echo "fixed")
echo "RELEASE_STRATEGY=$RELEASE_STRATEGY" >> "$GITHUB_OUTPUT"
- id: get-release-version
shell: bash
run: echo "RELEASE_VERSION=$(jq --raw-output '.version' package.json)" >> "$GITHUB_OUTPUT"
- id: get-repository-url
shell: bash
run: echo "REPOSITORY_URL=$(jq --raw-output '.repository.url' package.json)" >> "$GITHUB_OUTPUT"
- id: get-release-packages
if: steps.get-version-strategy.outputs.RELEASE_STRATEGY == 'independent'
shell: bash
run: |
${{ github.action_path }}/scripts/get-release-packages.sh
# This sets RELEASE_NOTES as an environment variable, which is expected
# by the create-github-release step.
- id: get-release-notes
shell: bash
run: node ${{ github.action_path }}/dist/index.js
env:
RELEASE_STRATEGY: ${{ steps.get-version-strategy.outputs.RELEASE_STRATEGY }}
RELEASE_VERSION: ${{ steps.get-release-version.outputs.RELEASE_VERSION }}
REPOSITORY_URL: ${{ steps.get-repository-url.outputs.REPOSITORY_URL }}
RELEASE_PACKAGES: ${{ steps.get-release-packages.outputs.RELEASE_PACKAGES }}
- id: create-github-release
shell: bash
run: |
${{ github.action_path }}/scripts/create-github-release.sh
env:
RELEASE_COMMIT_ID: ${{ github.sha }}
RELEASE_STRATEGY: ${{ steps.get-version-strategy.outputs.RELEASE_STRATEGY }}
RELEASE_VERSION: ${{ steps.get-release-version.outputs.RELEASE_VERSION }}
RELEASE_PACKAGES: ${{ steps.get-release-packages.outputs.RELEASE_PACKAGES }}