Skip to content

Update GitHub Actions workflow to create a release and upload asset #34

Update GitHub Actions workflow to create a release and upload asset

Update GitHub Actions workflow to create a release and upload asset #34

Workflow file for this run

name: Rust
on:
push:
branches: [ "main" ]
tags:
- 'v*' # Trigger the workflow on push to tags like v1.0, v20.15.10
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y zlib1g-dev libelf-dev
- name: Test
run: cargo test
- name: Build
run: cargo build --release
- uses: actions/[email protected]
with:
name: bpftop
path: target/release/bpftop
create_release:
needs: build_and_test
runs-on: ubuntu-latest
permissions:
contents: write
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/[email protected]
- name: Create Release and Upload Asset
uses: ncipollo/[email protected]
with:
artifacts: "target/release/bpftop"
draft: true