remove macos build #1
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: Build and Release | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
include: | |
- os: ubuntu-latest | |
image: ubuntu:latest | |
- os: macos-latest | |
image: macos-latest | |
- os: windows-latest | |
image: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up build tools on Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
choco install make | |
choco install mingw | |
shell: powershell | |
- name: Set up build tools on Linux | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
apt-get update | |
apt-get install -y gcc | |
- name: Set up build tools on macOS | |
if: matrix.os == 'macos-latest' | |
run: | | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
brew install gcc | |
- name: Build on Linux and macOS | |
if: matrix.os != 'windows-latest' | |
run: | | |
gcc await.c -o await -lpthread | |
- name: Build on Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
gcc await.c -o await.exe -lpthread | |
- name: Create release directory | |
run: mkdir -p releases | |
- name: Move binary to release directory | |
run: | | |
if [ ${{ matrix.os }} == 'windows-latest' ]; then | |
mv await.exe releases/await_${{ github.ref_name }}_windows_amd64.exe | |
elif [ ${{ matrix.os }} == 'macos-latest' ]; then | |
mv await releases/await_${{ github.ref_name }}_macos_amd64 | |
else | |
mv await releases/await_${{ github.ref_name }}_linux_amd64 | |
fi | |
- name: Set dummy ACTIONS_RUNTIME_TOKEN for act | |
if: ${{ env.ACT }} | |
run: echo "::set-env name=ACTIONS_RUNTIME_TOKEN::dummy_token" | |
uses: actions/upload-artifact@v2 | |
with: | |
name: release-binaries | |
path: releases/ | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download release assets | |
uses: actions/download-artifact@v2 | |
with: | |
name: release-binaries | |
path: releases/ | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: releases/* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |