Skip to content

Commit 9677dad

Browse files
authored
Fix: [AEA-0000] - allow adding artifact to release (#18)
## Summary - Routine Change ### Details - add new optional param to allow adding artifact to release
1 parent 3932c17 commit 9677dad

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

.github/workflows/tag-release.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ on:
2929
required: false
3030
type: string
3131
default: "main"
32+
extra_artifact_name:
33+
description: "An extra artifact to include in the release"
34+
required: false
35+
type: string
36+
extra_artifact_url:
37+
description: "An url to download the extra artifact to include in the release"
38+
required: false
39+
type: string
3240
outputs:
3341
version_tag:
3442
value: ${{ jobs.tag_release.outputs.version_tag }}
@@ -231,6 +239,13 @@ jobs:
231239
make install
232240
make build
233241
242+
- name: Download extra artifact
243+
if: ${{ inputs.extra_artifact_url != '' }}
244+
run: |
245+
curl -L -o "${EXTRA_ASSET}" "${EXTRA_ASSET_URL}"
246+
env:
247+
EXTRA_ASSET: ${{ inputs.extra_artifact_name }}
248+
EXTRA_ASSET_URL: ${{ inputs.extra_artifact_url }}
234249
- name: Set VERSION_TAG based on dry_run flag
235250
id: output_version_tag
236251
run: |
@@ -286,6 +301,7 @@ jobs:
286301
TAG_FORMAT: ${{ inputs.tag_format }}
287302
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
288303
MAIN_BRANCH: ${{ inputs.main_branch }}
304+
EXTRA_ASSET: ${{ inputs.extra_artifact_name }}
289305

290306
- name: Create semantic release tag
291307
if: ${{ !inputs.dry_run }}
@@ -295,6 +311,7 @@ jobs:
295311
PUBLISH_PACKAGE: ${{ inputs.publish_package }}
296312
TAG_FORMAT: ${{ inputs.tag_format }}
297313
MAIN_BRANCH: ${{ inputs.main_branch }}
314+
EXTRA_ASSET: ${{ inputs.extra_artifact_name }}
298315
run: |
299316
npx semantic-release --tag-format "${TAG_FORMAT}"
300317

release.config.cjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,13 @@ module.exports = {
7575
{
7676
path: "CHANGELOG.md",
7777
label: "CHANGELOG.md"
78-
}
78+
},
79+
...(process.env.EXTRA_ASSET ? [
80+
{
81+
path: process.env.EXTRA_ASSET,
82+
label: process.env.EXTRA_ASSET
83+
}
84+
] : [])
7985
],
8086
successComment: false,
8187
failComment: false,

0 commit comments

Comments
 (0)