From dee2845edc835074cf8b905e177bc329ca5386bb Mon Sep 17 00:00:00 2001 From: Andrea Telatin <15690844+telatin@users.noreply.github.com> Date: Wed, 18 Sep 2024 15:05:01 +0100 Subject: [PATCH] Update test_n50.yml --- .github/workflows/test_n50.yml | 36 ++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_n50.yml b/.github/workflows/test_n50.yml index 3f41cdc..ef0e10a 100644 --- a/.github/workflows/test_n50.yml +++ b/.github/workflows/test_n50.yml @@ -5,6 +5,8 @@ on: branches: [ main ] pull_request: branches: [ main ] + release: + types: [created] workflow_dispatch: jobs: @@ -12,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install dependencies run: | @@ -29,7 +31,37 @@ jobs: run: make test-simple - name: Archive binary - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: n50-calculator path: bin/n50 + + release-binary: + needs: build-and-test + if: github.event_name == 'release' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y gcc make zlib1g-dev + + - name: Build N50 Calculator + run: make + + - name: Compress binary + run: | + tar -czvf n50-calculator-linux-amd64.tar.gz -C bin n50 + + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./n50-calculator-linux-amd64.tar.gz + asset_name: n50-calculator-linux-amd64.tar.gz + asset_content_type: application/gzip