From 1f29bfa5a689ba0ec2beb65d2824f214b871faab Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Fri, 1 Mar 2024 16:03:26 +0100 Subject: [PATCH] .github: set 'latest' flag for non-pre-release builds Signed-off-by: Joachim Wiberg --- .github/workflows/release.yml | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0d0b3679d..5b76cbaa3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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} @@ -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-*" @@ -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