Skip to content

Commit

Permalink
💚 fix: build and release
Browse files Browse the repository at this point in the history
  • Loading branch information
camargo2019 committed Sep 10, 2024
1 parent 3703786 commit 070245e
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,29 @@ 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: |
mkdir -p release
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'
Expand All @@ -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:
Expand Down

0 comments on commit 070245e

Please sign in to comment.