Update GitHub workflow #439
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
--- | |
on: | |
push: | |
tags: | |
- "v*" | |
permissions: | |
contents: write | |
name: Build and release | |
jobs: | |
create_release: | |
runs-on: ubuntu-latest | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Tau ${{ github.ref }} | |
draft: false | |
prerelease: false | |
# Build for Linux (both x86_64 and aarch64) | |
build-linux: | |
runs-on: ubuntu-latest | |
needs: create_release | |
strategy: | |
fail-fast: false | |
matrix: | |
go-version: [1.23.x] | |
arch: [x86_64, arm64] | |
steps: | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Initialize and update submodules | |
run: git submodule init && git submodule update | |
- name: Build for Linux | |
run: make && mv tau tau-linux-${{ matrix.arch }} | |
- name: Upload Linux artifact to release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.create_release.outputs.upload_url }} | |
asset_path: ./tau-linux-${{ matrix.arch }} | |
asset_name: tau-linux-${{ matrix.arch }} | |
asset_content_type: application/octet-stream | |
# Build for Windows (only x86_64) | |
build-windows: | |
runs-on: ubuntu-latest | |
needs: create_release | |
strategy: | |
fail-fast: false | |
matrix: | |
go-version: [1.23.x] | |
arch: [x86_64, arm64] | |
steps: | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.22.x | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install MinGW | |
run: sudo apt install mingw-w64 -y | |
- name: Initialize and update submodules | |
run: git submodule init && git submodule update | |
- name: Build for Windows x86_64 | |
run: make windows && mv tau.exe tau-windows-x86_64.exe | |
- name: Upload Windows artifact to release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.create_release.outputs.upload_url }} | |
asset_path: ./tau-windows-x86_64.exe | |
asset_name: tau-windows-x86_64.exe | |
asset_content_type: application/octet-stream | |
# Build for MacOS | |
build-macos: | |
runs-on: macos-latest | |
needs: create_release | |
strategy: | |
fail-fast: false | |
matrix: | |
go-version: [1.23.x] | |
arch: [x86_64, arm64] | |
steps: | |
- name: Build MacOS | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- uses: actions/checkout@v4 | |
- run: git submodule init && git submodule update | |
- run: brew install gcc@14 make automake libtool texinfo autoconf | |
- run: make CC=gcc-14 && mv tau tau-macos-${{ matrix.arch }} | |
- name: Upload MacOS artifact to release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.create_release.outputs.upload_url }} | |
asset_path: ./tau-macos-${{ matrix.arch }} | |
asset_name: tau-macos-${{ matrix.arch }} | |
asset_content_type: application/octet-stream |