Release #61
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: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: "Version Tag (vX.X.X)" | |
type: string | |
required: true | |
prerelease: | |
type: boolean | |
required: false | |
default: true | |
jobs: | |
build: | |
name: Build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-13] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.18.0-beta1 | |
stable: false | |
- name: Go Test | |
run: go test | |
- name: Install and run dependencies (xvfb libx11-dev) | |
if: ${{ runner.os == 'Linux' }} | |
run: | | |
sudo apt update | |
sudo apt install -y xvfb libx11-dev x11-utils libegl1-mesa-dev libgles2-mesa-dev | |
Xvfb :0 -screen 0 1024x768x24 > /dev/null 2>&1 & | |
# Wait for Xvfb | |
MAX_ATTEMPTS=120 # About 60 seconds | |
COUNT=0 | |
echo -n "Waiting for Xvfb to be ready..." | |
while ! xdpyinfo -display "${DISPLAY}" >/dev/null 2>&1; do | |
echo -n "." | |
sleep 0.50s | |
COUNT=$(( COUNT + 1 )) | |
if [ "${COUNT}" -ge "${MAX_ATTEMPTS}" ]; then | |
echo " Gave up waiting for X server on ${DISPLAY}" | |
exit 1 | |
fi | |
done | |
echo "Done - Xvfb is ready!" | |
- name: Install dependencies on macOS | |
if: matrix.os == 'macos-13' | |
run: | | |
brew install filosottile/musl-cross/musl-cross | |
brew install libx11 | |
ln -s /opt/X11/include/X11 /usr/local/include/X11 | |
- name: Install dependencies on Windows | |
if: matrix.os == 'windows-latest' | |
run: choco install make | |
- name: Build | |
run: | | |
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then | |
make linux | |
elif [ "${{ matrix.os }}" == "windows-latest" ]; then | |
make windows | |
elif [ "${{ matrix.os }}" == "macos-13" ]; then | |
make macos | |
fi | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build-${{ matrix.os }} | |
path: dist/ | |
tag_and_release: | |
needs: build | |
runs-on: macos-13 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Download build artifacts from Linux | |
uses: actions/download-artifact@v3 | |
with: | |
name: build-ubuntu-latest | |
path: dist/linux | |
- name: Download build artifacts from Windows | |
uses: actions/download-artifact@v3 | |
with: | |
name: build-windows-latest | |
path: dist/windows | |
- name: Download build artifacts from macOS | |
uses: actions/download-artifact@v3 | |
with: | |
name: build-macos-13 | |
path: dist/macos | |
- name: Create Tag | |
uses: negz/create-tag@v1 | |
with: | |
version: ${{ github.event.inputs.tag }} | |
message: "create tag" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create changelog text | |
id: changelog | |
uses: loopwerk/tag-changelog@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Print changelog | |
run: | | |
cat <<EOF | |
${{ steps.changelog.outputs.changes }} | |
EOF | |
- name: Release & Assets | |
uses: Hs1r1us/Release-AIO@v1.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.event.inputs.tag }} | |
release_name: Upgit ${{ github.event.inputs.tag }} | |
body: ${{ steps.changelog.outputs.changes }} | |
asset_files: | | |
dist/linux/* | |
dist/windows/* | |
dist/macos/* | |
draft: false | |
prerelease: ${{ github.event.inputs.prerelease }} |