Skip to content

Commit

Permalink
Update test_n50.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
telatin authored Sep 18, 2024
1 parent d91e735 commit dee2845
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions .github/workflows/test_n50.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ on:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [created]
workflow_dispatch:

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install dependencies
run: |
Expand All @@ -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

0 comments on commit dee2845

Please sign in to comment.