diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2669a5c..998e511 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: run: | sudo apt-get -y update sudo apt-get -y install bats tree - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Configure run: | ./autogen.sh @@ -53,7 +53,7 @@ jobs: runs-on: ubuntu-latest container: debian:stable steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Installing dependencies run: | apt-get update diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index e87195c..ccb1183 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -17,7 +17,7 @@ jobs: MAKEFLAGS: -j3 IMAGE_NAME: netcalc steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build image run: docker build . --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" - name: Log in to registry diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index eaacf28..455aba3 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -15,7 +15,7 @@ jobs: coverity: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Fetch latest Coverity Scan MD5 id: var env: @@ -27,7 +27,7 @@ jobs: export MD5=$(cat coverity-latest.tar.gz.md5) echo "Got MD5 $MD5" echo ::set-output name=md5::${MD5} - - uses: actions/cache@v2 + - uses: actions/cache@v4 id: cache with: path: coverity-latest.tar.gz @@ -72,7 +72,7 @@ jobs: --form description="${PROJECT_NAME} $(git rev-parse HEAD)" \ https://scan.coverity.com/builds?project=${COVERITY_PROJ} - name: Upload build.log - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: coverity-build.log path: cov-int/build-log.txt diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 431af6e..f6423e4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,56 +7,49 @@ on: jobs: release: - name: Create GitHub release - runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/') - outputs: - upload_url: ${{ steps.create_release.outputs.upload_url }} - release_id: ${{ steps.create_release.outputs.id }} - steps: - - uses: actions/checkout@v2 - - name: Extract ChangeLog entry ... - # Hack to extract latest entry for body_path below - run: | - awk '/-----*/{if (x == 1) exit; x=1;next}x' ChangeLog.md \ - |head -n -1 > release.md - cat release.md - - name: Create release ... - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: netcalc ${{ github.ref }} - body_path: release.md - draft: false - prerelease: false - tarball: name: Build and upload release tarball - needs: release if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Installing dependencies ... run: | sudo apt-get -y update sudo apt-get -y install bats + - name: Setting release variables ... + id: build + run: | + ver=${GITHUB_REF#refs/tags/} + echo "ver=${ver}" >> $GITHUB_OUTPUT + if echo $ver | grep -qE '^v[0-9]+\.[0-9]+(\.[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 - name: Creating Makefiles ... run: | ./autogen.sh ./configure - name: Build release ... run: | - make release + make release || (cat test/test-suite.log; false) ls -lF ../ mkdir -p artifacts/ mv ../*.tar.* artifacts/ - - name: Upload release artifacts ... - uses: skx/github-action-publish-binaries@release-0.15 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Extract ChangeLog entry ... + run: | + awk '/-----*/{if (x == 1) exit; x=1;next}x' ChangeLog.md \ + |head -n -1 > release.md + cat release.md + - uses: ncipollo/release-action@v1 with: - releaseId: ${{ needs.release.outputs.release_id }} - args: artifacts/* + name: netcalc ${{ github.ref_name }} + prerelease: ${{ steps.build.outputs.pre }} + makeLatest: ${{ steps.build.outputs.latest }} + bodyFile: "release.md" + artifacts: "artifacts/*"