Skip to content

Commit ef7f7d2

Browse files
Support assets in semver_release actions (#77)
1 parent 0d50093 commit ef7f7d2

3 files changed

Lines changed: 22 additions & 6 deletions

File tree

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ Creates a new GitHub release based on git tags and [semantic versioning](https:/
3030
variable for target branch name (see: https://cli.github.com/manual/gh_release_create).
3131

3232
### Inputs
33-
| Name | Description | Optional |
34-
|---------|:---------------------------------|----------|
35-
| major_v | major version of current release | False |
36-
| minor_v | minor version of current release | False |
33+
| Name | Description | Optional |
34+
|-------------|:-----------------------------------------|----------|
35+
| major_v | major version of current release | False |
36+
| minor_v | minor version of current release | False |
37+
| assets_path | assets to upload for the current release | True |
3738

3839
### Outputs
3940
| Name | Description |
@@ -56,10 +57,11 @@ jobs:
5657
with:
5758
fetch-depth: 0
5859
- name: Create Release
59-
uses: SneaksAndData/github-actions/semver_release@v0.0.17
60+
uses: SneaksAndData/github-actions/semver_release@v0.1.10
6061
with:
6162
major_v: 0
6263
minor_v: 0
64+
assets_path: ./dist
6365
```
6466
6567
## install_poetry

semver_release/action.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ inputs:
1414
description: minor version of current release
1515
required: true
1616

17+
assets_path:
18+
description: optional release assets. All files under the path prefix will be uploaded as release assets.
19+
required: false
20+
1721
outputs:
1822
version:
1923
description: "Version"
@@ -29,4 +33,5 @@ runs:
2933
MINOR_V: ${{ inputs.minor_v }}
3034
GITHUB_TOKEN: ${{ github.token }}
3135
TARGET_BRANCH_MAME: ${{ github.ref }}
36+
ASSETS_LOCATION: ${{ github.assets_path }}
3237
shell: bash

semver_release/semver_release.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,14 @@ else
3030
nextRevision='0'
3131
fi
3232
nextVersion="v$providedMajor.$providedMinor.$nextRevision"
33-
gh release create "$nextVersion" --generate-notes --target "$TARGET_BRANCH_MAME"
33+
34+
assets=$ASSETS_LOCATION
35+
36+
if [[ -z "${assets}" ]];
37+
then
38+
gh release create "$nextVersion" --generate-notes --target "$TARGET_BRANCH_MAME"
39+
else
40+
gh release create "$nextVersion" --generate-notes --target "$TARGET_BRANCH_MAME" "$assets/*.*"
41+
fi
42+
3443
echo "version=$nextVersion" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)