publish #4
Workflow file for this run
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: publish | |
on: | |
push: | |
tags: | |
- "*" # Trigger on any tag push | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
publish: | |
name: Publish for ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, windows-latest, macos-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Extract version from tag | |
id: extract_version | |
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- name: Install dependencies on Linux | |
if: matrix.os == 'ubuntu-20.04' | |
run: sudo apt-get install -y sqlite3 gcc unzip | |
- name: Install dependencies on Windows | |
if: matrix.os == 'windows-latest' | |
shell: pwsh | |
run: | | |
choco install -y mingw | |
choco install -y zip | |
choco install -y unzip | |
choco install -y sqlite | |
- name: Install dependencies on macOS | |
if: matrix.os == 'macos-latest' | |
run: | | |
brew install unzip | |
brew install sqlite | |
brew link sqlite --force | |
- name: Download and prepare sources | |
run: | | |
make prepare-dist | |
make download-sqlite | |
- name: Build for Linux | |
if: matrix.os == 'ubuntu-20.04' | |
run: | | |
make compile-linux | |
make pack-linux version=${{ env.VERSION }} | |
- name: Build for Windows | |
if: matrix.os == 'windows-latest' | |
shell: pwsh | |
run: | | |
make compile-windows | |
make pack-windows version=${{ env.VERSION }} | |
- name: Build for macOS | |
if: matrix.os == 'macos-latest' | |
run: | | |
make compile-macos-universal | |
make pack-macos-universal version=${{ env.VERSION }} | |
- name: Upload binaries to release | |
uses: svenstaro/[email protected] | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: dist/*.zip | |
file_glob: true | |
tag: ${{ github.ref_name }} |