Release #68
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: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt update | |
sudo apt install -y xvfb libx11-dev x11-utils libegl1-mesa-dev libgles2-mesa-dev | |
- 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 on Ubuntu | |
if: matrix.os == 'ubuntu-latest' | |
run: make linux | |
- name: Build on Windows | |
if: matrix.os == 'windows-latest' | |
run: make windows | |
- name: Build on macOS | |
if: matrix.os == 'macos-13' | |
run: make macos | |
- 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/[email protected] | |
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 }} | |
draft: false | |
prerelease: ${{ github.event.inputs.prerelease }} | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: dist/**/* | |
tag: ${{ github.ref }} | |
overwrite: true | |
file_glob: true |