Skip to content

Commit

Permalink
feat: add separator input to release related workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
galargh committed Jul 25, 2024
1 parent ab18a68 commit b99cede
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/release-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
required: false
type: string
default: '["version.json"]'
separator:
required: false
type: string
default: '/'
outputs:
json:
description: JSON aggregation of release.json artifacts
Expand Down Expand Up @@ -62,6 +66,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}
SOURCE: ${{ matrix.source }}
SEPARATOR: ${{ inputs.separator }}
HEAD_FULL_NAME: ${{ fromJSON(steps.pr.outputs.json).head.repo.full_name }}
HEAD_SHA: ${{ fromJSON(steps.pr.outputs.json).head.sha }}
run: |
Expand All @@ -70,7 +75,7 @@ jobs:
if [[ "$root" == "." ]]; then
prefix="v"
else
prefix="$root/v"
prefix="${root}${SEPARATOR}v"
fi
echo "prefix=$prefix" | tee -a $GITHUB_OUTPUT
# If `version.json` file doesn't exists, `version` is `""` and `404` is printed on stderr.
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
required: false
type: string
default: '["version.json"]'
separator:
required: false
type: string
default: '/'
outputs:
json:
description: JSON aggregation of release.json artifacts
Expand All @@ -31,12 +35,13 @@ jobs:
name: Determine version
env:
SOURCE: ${{ matrix.source }}
SEPARATOR: ${{ inputs.separator }}
run: |
prefix="$(dirname "$SOURCE")"
if [[ "$prefix" == "." ]]; then
root="$(dirname "$SOURCE")"
if [[ "$root" == "." ]]; then
prefix="v"
else
prefix="$prefix/v"
prefix="${root}${SEPARATOR}v"
fi
echo "prefix=$prefix" | tee -a $GITHUB_OUTPUT
version="$(yq -r '.workspace.package.version // .package.version // .version // ""' "$SOURCE")"
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## [1.0.8] - 2024-07-25
### Added
- separator input to releaser and releaser-check workflows

## [1.0.7] - 2024-07-25
### Added
- aggregation of release.json artifacts as workflow outputs
Expand Down

0 comments on commit b99cede

Please sign in to comment.