Skip to content

feat(ci): embed release version automatically #1

feat(ci): embed release version automatically

feat(ci): embed release version automatically #1

Workflow file for this run

name: Build and Release
on:
push:
tags:
- "v*"
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get version from tag
id: version
run: echo "VERSION=${GITHUB_REF_NAME}" >> $GITHUB_ENV
- name: Install dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update && sudo apt-get install -y libncurses5-dev libncursesw5-dev
- name: Install dependencies (macOS)
if: matrix.os == 'macos-latest'
run: brew install ncurses
- name: Build
run: make build VERSION=${{ env.VERSION }}
- name: Package
run: |
mkdir dist
cp build/particulate dist/
tar -czvf particulate-${{ matrix.os }}-${{ env.VERSION }}.tar.gz -C dist .
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: particulate-${{ matrix.os }}-${{ env.VERSION }}
path: particulate-${{ matrix.os }}-${{ env.VERSION }}.tar.gz
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: |
**/*.tar.gz