From 070245e6f9faab3d9ca5341601b82c0fd5304747 Mon Sep 17 00:00:00 2001 From: Gabriel Camargo Date: Tue, 10 Sep 2024 08:09:53 -0300 Subject: [PATCH] :green_heart: fix: build and release --- .github/workflows/build-and-release.yml | 32 ++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index a587b9d..d33d2f3 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -43,6 +43,21 @@ jobs: if: matrix.os != 'windows-latest' run: clang++ -o cmr_cache main.cpp -I./vendor/yaml -lboost_system -lpthread -std=c++17 + - name: Get the tag + run: echo "GITHUB_REF=${{ github.ref }}" + + - name: Extract the tag name + id: extract_tag + run: echo "TAG_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV + + - name: Create GitHub Release + id: create_release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ env.TAG_NAME }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create Release Archive - Windows if: matrix.os == 'windows-latest' run: | @@ -50,7 +65,7 @@ jobs: cp cmr_cache.exe release/ cp -r config/ release/ cp -r data/ release/ - tar -czf cmr_cache_${{ matrix.os }}.tar.gz release + tar -czf cmr_cache_${{ matrix.os }}-${{ env.TAG_NAME }}.tar.gz release - name: Create Release Archive - Others OS if: matrix.os != 'windows-latest' @@ -61,21 +76,6 @@ jobs: cp -r data/ release/ tar -czf cmr_cache_${{ matrix.os }}-${{ env.TAG_NAME }}.tar.gz release - - name: Get the tag - run: echo "GITHUB_REF=${{ github.ref }}" - - - name: Extract the tag name - id: extract_tag - run: echo "TAG_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV - - - name: Create GitHub Release - id: create_release - uses: softprops/action-gh-release@v1 - with: - tag_name: ${{ env.TAG_NAME }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload Release Asset uses: actions/upload-release-asset@v1 with: