Skip to content

Commit

Permalink
.github: set 'latest' flag for non-pre-release builds
Browse files Browse the repository at this point in the history
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
  • Loading branch information
troglobit committed Mar 1, 2024
1 parent aea6ef3 commit 1f29bfa
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ jobs:
ver=${GITHUB_REF#refs/tags/}
fi
echo "ver=${ver}" >> $GITHUB_OUTPUT
if echo $ver | grep -qE 'v[0-9\.]+(-alpha|-beta|-rc)[0-9]*'; then
echo "pre=true" >> $GITHUB_OUTPUT
else
echo "pre=false" >> $GITHUB_OUTPUT
fi
fver=${ver#v}
if [ "${{ matrix.variant }}" = "netconf" ]; then
target=${{ matrix.platform }}-${fver}
Expand Down Expand Up @@ -106,6 +101,24 @@ jobs:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set Release Variables
run: |
if [ -n "${{ inputs.version }}" ]; then
ver=${{ inputs.version }}
else
ver=${GITHUB_REF#refs/tags/}
fi
echo "ver=${ver}" >> $GITHUB_OUTPUT
if echo $ver | grep -qE 'v[0-9.]+(-alpha|-beta|-rc)[0-9]*'; then
echo "pre=true" >> $GITHUB_OUTPUT
else
echo "pre=false" >> $GITHUB_OUTPUT
fi
if echo $ver | grep -qE '^v[0-9.]+\.[0-9.]+(\.[0-9]+)?$'; then
echo "latest=true" >> $GITHUB_OUTPUT
else
echo "latest=false" >> $GITHUB_OUTPUT
fi
- uses: actions/download-artifact@v4
with:
pattern: "artifact-*"
Expand All @@ -123,7 +136,8 @@ jobs:
- uses: ncipollo/release-action@v1
with:
name: Infix ${{ github.ref_name }}
prerelease: ${{ needs.build.outputs.pre }}
prerelease: ${{ steps.release.outputs.pre }}
makeLatest: ${{ steps.release.outputs.latest }}
bodyFile: release.md
artifacts: "*.tar.gz*"
- name: Summary
Expand Down

0 comments on commit 1f29bfa

Please sign in to comment.