Update README.md #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: N50 Calculator CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
release: | |
types: [created] | |
workflow_dispatch: | |
jobs: | |
build-and-test-linux: | |
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 clean && make | |
- name: Run tests | |
run: make test | |
- name: Run simple test | |
run: make autotest | |
- name: Archive binary | |
uses: actions/upload-artifact@v4 | |
with: | |
name: n50-calculator-linux | |
path: bin/n50 | |
build-and-test-macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
brew install gcc make zlib | |
- name: Build N50 Calculator | |
run: make clean && make | |
- name: Run tests | |
run: make test | |
- name: Run simple test | |
run: make autotest | |
- name: Archive binary | |
uses: actions/upload-artifact@v4 | |
with: | |
name: n50-calculator-macos | |
path: bin/n50 | |
release-binaries: | |
needs: [build-and-test-linux, build-and-test-macos] | |
if: github.event_name == 'release' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download Linux artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: n50-calculator-linux | |
path: linux-binary | |
- name: Download MacOS artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: n50-calculator-macos | |
path: macos-binary | |
- name: Compress Linux binary | |
run: | | |
tar -czvf n50-calculator-linux-amd64.tar.gz -C linux-binary n50 | |
- name: Compress MacOS binary | |
run: | | |
tar -czvf n50-calculator-macos-amd64.tar.gz -C macos-binary n50 | |
- name: Upload Linux 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 | |
- name: Upload MacOS 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-macos-amd64.tar.gz | |
asset_name: n50-calculator-macos-amd64.tar.gz | |
asset_content_type: application/gzip |