Skip to content

Commit 8a61ccd

Browse files
committed
Refactor tests.yaml to include outputs for version and should_publish
1 parent 33b12da commit 8a61ccd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

.github/workflows/tests.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ jobs:
3232
is-unpublished:
3333
runs-on: ubuntu-latest
3434
name: Is this version unpublished?
35+
outputs:
36+
should_publish: ${{ steps.compare.outputs.should_publish }}
37+
version: ${{ steps.extract_version.outputs.version }}
3538
steps:
3639
- uses: actions/checkout@v4
3740
- name: Install Rust Toolchain
@@ -53,6 +56,7 @@ jobs:
5356
id: latest_version
5457
run: echo "LATEST_VERSION=$(cargo search ${{ env.PACKAGE_NAME }} --limit 1 | grep -oP '(?<=").*(?=")' | head -1)" >> $GITHUB_ENV
5558
- name: Compare versions
59+
id: compare
5660
run: |
5761
if [ "$(printf '%s\n' "${{ env.LATEST_VERSION }}" "${{ env.PACKAGE_VERSION }}" | sort -V | tail -n1)" = "${{ env.PACKAGE_VERSION }}" ] && [ "${{ env.PACKAGE_VERSION }}" != "${{ env.LATEST_VERSION }}" ]; then
5862
echo "Local version (${{ env.PACKAGE_VERSION }}) is newer than the latest published version (${{ env.LATEST_VERSION }})"

0 commit comments

Comments
 (0)